1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_DISPLAY_SCREEN_POSITION_CONTROLLER_H_
6 #define ASH_DISPLAY_SCREEN_POSITION_CONTROLLER_H_
10 #include "base/basictypes.h"
11 #include "ui/aura/client/screen_position_client.h"
15 class ScreenPositionController
: public aura::client::ScreenPositionClient
{
17 // Finds the root window at |location| in |window|'s coordinates
18 // from given |root_windows| and returns the found root window and
19 // location in that root window's coordinates. The function usually
20 // returns |window->GetRootWindow()|, but if the mouse pointer is
21 // moved outside the |window|'s root while the mouse is captured, it
22 // returns the other root window.
23 static void ConvertHostPointToRelativeToRootWindow(
24 aura::Window
* root_window
,
25 const std::vector
<aura::Window
*>& root_windows
,
26 gfx::Point
* point_in_host
,
27 aura::Window
** target_window
);
29 ScreenPositionController() {}
30 ~ScreenPositionController() override
{}
32 // aura::client::ScreenPositionClient overrides:
33 void ConvertPointToScreen(const aura::Window
* window
,
34 gfx::Point
* point
) override
;
35 void ConvertPointFromScreen(const aura::Window
* window
,
36 gfx::Point
* point
) override
;
37 void ConvertHostPointToScreen(aura::Window
* window
,
38 gfx::Point
* point
) override
;
39 void SetBounds(aura::Window
* window
,
40 const gfx::Rect
& bounds
,
41 const gfx::Display
& display
) override
;
44 DISALLOW_COPY_AND_ASSIGN(ScreenPositionController
);
49 #endif // ASH_DISPLAY_SCREEN_POSITION_CONTROLLER_H_