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(); |
} |