Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef ASH_WM_COORDINATE_CONVERSION_H_ | |
| 6 #define ASH_WM_COORDINATE_CONVERSION_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 | |
| 10 #include "ui/gfx/point.h" | |
| 11 | |
| 12 namespace aura { | |
| 13 class RootWindow; | |
| 14 class Window; | |
| 15 } // namespace gfx | |
| 16 | |
| 17 namespace gfx { | |
| 18 class Rect; | |
| 19 } // namespace gfx | |
| 20 | |
| 21 namespace ash { | |
| 22 namespace wm { | |
| 23 | |
| 24 // Returns the RootWindow at |point| in the virtual screen coordinates. | |
| 25 // Returns NULL if the root window does not exist at the given | |
| 26 // point. | |
| 27 ASH_EXPORT aura::RootWindow* GetRootWindowAt(const gfx::Point& point); | |
| 28 | |
| 29 // Returns the RootWindow that shares the most area with |rect| in | |
| 30 // the virtual scren coordinates. | |
| 31 ASH_EXPORT aura::RootWindow* GetRootWindowMatching(const gfx::Rect& rect); | |
| 32 | |
| 33 // Gets the root window at |location| in |window|'s coordinates. This function | |
| 34 // just returns a pair of |window->GetRootWindow()| and location in the root | |
|
sky
2012/08/03 17:07:18
remove just
Yusuke Sato
2012/08/03 23:18:45
Done.
| |
| 35 // window's coordinate unless the cursor is captured by the root window (so you | |
| 36 // don't want to call the function when it's not captured). When it's captured, | |
|
sky
2012/08/03 17:07:18
I'm confused by this restriction, which means it's
Yusuke Sato
2012/08/03 23:18:45
Sorry, the comment was very confusing. It's safe t
| |
| 37 // the function tries to find an actual root window where the cursor is | |
| 38 // currently on in a platform specific way, and returns the root window along | |
| 39 // with the location in the actual root window's coordinates. | |
| 40 ASH_EXPORT std::pair<aura::RootWindow*, gfx::Point> | |
| 41 GetRootWindowRelativeToWindow(aura::Window* window, const gfx::Point& location); | |
| 42 | |
| 43 } // namespace wm | |
| 44 } // namespace ash | |
| 45 | |
| 46 #endif // ASH_WM_COORDINATE_CONVERSION_H_ | |
| OLD | NEW |