Index: ash/wm/coordinate_conversion.h |
diff --git a/ash/wm/coordinate_conversion.h b/ash/wm/coordinate_conversion.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..40b6fb1d187649e17ee6b679d033694b4f3073ff |
--- /dev/null |
+++ b/ash/wm/coordinate_conversion.h |
@@ -0,0 +1,46 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ASH_WM_COORDINATE_CONVERSION_H_ |
+#define ASH_WM_COORDINATE_CONVERSION_H_ |
+ |
+#include "ash/ash_export.h" |
+ |
+#include "ui/gfx/point.h" |
+ |
+namespace aura { |
+class RootWindow; |
+class Window; |
+} // namespace gfx |
+ |
+namespace gfx { |
+class Rect; |
+} // namespace gfx |
+ |
+namespace ash { |
+namespace wm { |
+ |
+// Returns the RootWindow at |point| in the virtual screen coordinates. |
+// Returns NULL if the root window does not exist at the given |
+// point. |
+ASH_EXPORT aura::RootWindow* GetRootWindowAt(const gfx::Point& point); |
+ |
+// Returns the RootWindow that shares the most area with |rect| in |
+// the virtual scren coordinates. |
+ASH_EXPORT aura::RootWindow* GetRootWindowMatching(const gfx::Rect& rect); |
+ |
+// Gets the root window at |location| in |window|'s coordinates. This function |
+// 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.
|
+// window's coordinate unless the cursor is captured by the root window (so you |
+// 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
|
+// the function tries to find an actual root window where the cursor is |
+// currently on in a platform specific way, and returns the root window along |
+// with the location in the actual root window's coordinates. |
+ASH_EXPORT std::pair<aura::RootWindow*, gfx::Point> |
+GetRootWindowRelativeToWindow(aura::Window* window, const gfx::Point& location); |
+ |
+} // namespace wm |
+} // namespace ash |
+ |
+#endif // ASH_WM_COORDINATE_CONVERSION_H_ |