Updated window handling API to solve deprecation warning.

DEPRECATION WARNING: Passing string argument to #within_window is deprecated. Pass window object or lambda.