summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/view.cc6
-rw-r--r--views/view.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/views/view.cc b/views/view.cc
index 9acbd47..04dbc40 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -1257,6 +1257,12 @@ void View::ConvertPointToScreen(const View* src, gfx::Point* p) {
}
}
+gfx::Rect View::GetScreenBounds() const {
+ gfx::Point origin;
+ View::ConvertPointToScreen(this, &origin);
+ return gfx::Rect(origin, size());
+}
+
/////////////////////////////////////////////////////////////////////////////
//
// View - event handlers
diff --git a/views/view.h b/views/view.h
index c5268c2..293c5c7 100644
--- a/views/view.h
+++ b/views/view.h
@@ -644,6 +644,9 @@ class View : public AcceleratorTarget {
// screen. This is useful for example when placing popup windows.
static void ConvertPointToScreen(const View* src, gfx::Point* point);
+ // Return the bounds of the View in screen coordinate system.
+ gfx::Rect GetScreenBounds() const;
+
// Event Handlers
// This method is invoked when the user clicks on this view.