Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: ui/views/view.cc

Issue 1279023002: [Views] Make ConvertPointToScreen work without Widget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 3c2aed7dbab63c64d06b4554d32574d33b66d92f..883414ed6720e891d42cd84f28736f755122c912 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -679,11 +679,10 @@ void View::ConvertPointToScreen(const View* src, gfx::Point* p) {
DCHECK(p);
// If the view is not connected to a tree, there's nothing we can do.
+ ConvertPointToWidget(src, p);
const Widget* widget = src->GetWidget();
- if (widget) {
- ConvertPointToWidget(src, p);
+ if (widget)
*p += widget->GetClientAreaBoundsInScreen().OffsetFromOrigin();
- }
}
// static
@@ -692,9 +691,8 @@ void View::ConvertPointFromScreen(const View* dst, gfx::Point* p) {
DCHECK(p);
const views::Widget* widget = dst->GetWidget();
- if (!widget)
- return;
- *p -= widget->GetClientAreaBoundsInScreen().OffsetFromOrigin();
+ if (widget)
+ *p -= widget->GetClientAreaBoundsInScreen().OffsetFromOrigin();
views::View::ConvertPointFromWidget(dst, p);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698