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

Unified Diff: chrome/browser/ui/views/validation_message_bubble_view.cc

Issue 2751833004: Reland "Add display::GetDisplayNearestView" (Closed)
Patch Set: Created 3 years, 9 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
Index: chrome/browser/ui/views/validation_message_bubble_view.cc
diff --git a/chrome/browser/ui/views/validation_message_bubble_view.cc b/chrome/browser/ui/views/validation_message_bubble_view.cc
index 239ebef62b681a3ce25e015d170fac9a67ebac20..781b2b49c68a1386a9a0ac55cd8ee4aa99d0b85d 100644
--- a/chrome/browser/ui/views/validation_message_bubble_view.cc
+++ b/chrome/browser/ui/views/validation_message_bubble_view.cc
@@ -7,9 +7,8 @@
#include "chrome/grit/theme_resources.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents.h"
+#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/display/display.h"
-#include "ui/display/screen.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/widget/widget.h"
@@ -87,9 +86,7 @@ gfx::Rect ValidationMessageBubbleView::RootViewToScreenRect(
const gfx::Rect& rect_in_root_view,
const content::RenderWidgetHostView* render_widget_host_view) const {
gfx::NativeView view = render_widget_host_view->GetNativeView();
- display::Display display =
- display::Screen::GetScreen()->GetDisplayNearestWindow(view);
- const float scale = display.device_scale_factor();
+ const float scale = ui::GetScaleFactorForNativeView(view);
return gfx::ScaleToEnclosingRect(rect_in_root_view, 1 / scale) +
render_widget_host_view->GetViewBounds().origin().OffsetFromOrigin();
}
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_button.cc ('k') | chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698