fixup! Fix for Geolocation webTCT failures
[platform/framework/web/chromium-efl.git] / ash / display / screen_position_controller.h
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_DISPLAY_SCREEN_POSITION_CONTROLLER_H_
6 #define ASH_DISPLAY_SCREEN_POSITION_CONTROLLER_H_
7
8 #include <vector>
9
10 #include "ash/ash_export.h"
11 #include "ui/aura/client/screen_position_client.h"
12
13 namespace ash {
14
15 class ASH_EXPORT ScreenPositionController
16     : public aura::client::ScreenPositionClient {
17  public:
18   // Finds the root window at |location| in |window|'s coordinates
19   // from given |root_windows| and returns the found root window and
20   // location in that root window's coordinates. The function usually
21   // returns |window->GetRootWindow()|, but if the mouse pointer is
22   // moved outside the |window|'s root while the mouse is captured, it
23   // returns the other root window.
24   static void ConvertHostPointToRelativeToRootWindow(
25       aura::Window* root_window,
26       const std::vector<aura::Window*>& root_windows,
27       gfx::Point* point_in_host,
28       aura::Window** target_window);
29
30   ScreenPositionController() {}
31
32   ScreenPositionController(const ScreenPositionController&) = delete;
33   ScreenPositionController& operator=(const ScreenPositionController&) = delete;
34
35   ~ScreenPositionController() override {}
36
37   // aura::client::ScreenPositionClient overrides:
38   void ConvertPointToScreen(const aura::Window* window,
39                             gfx::PointF* point) override;
40   void ConvertPointFromScreen(const aura::Window* window,
41                               gfx::PointF* point) override;
42   void ConvertHostPointToScreen(aura::Window* window,
43                                 gfx::Point* point) override;
44   void SetBounds(aura::Window* window,
45                  const gfx::Rect& bounds,
46                  const display::Display& display) override;
47
48  protected:
49   // aura::client::ScreenPositionClient:
50   gfx::Point GetRootWindowOriginInScreen(
51       const aura::Window* root_window) override;
52 };
53
54 }  // namespace ash
55
56 #endif  // ASH_DISPLAY_SCREEN_POSITION_CONTROLLER_H_