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

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

Issue 2747143005: Revert of 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 781b2b49c68a1386a9a0ac55cd8ee4aa99d0b85d..239ebef62b681a3ce25e015d170fac9a67ebac20 100644
--- a/chrome/browser/ui/views/validation_message_bubble_view.cc
+++ b/chrome/browser/ui/views/validation_message_bubble_view.cc
@@ -7,8 +7,9 @@
#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"
@@ -86,7 +87,9 @@
const gfx::Rect& rect_in_root_view,
const content::RenderWidgetHostView* render_widget_host_view) const {
gfx::NativeView view = render_widget_host_view->GetNativeView();
- const float scale = ui::GetScaleFactorForNativeView(view);
+ display::Display display =
+ display::Screen::GetScreen()->GetDisplayNearestWindow(view);
+ const float scale = display.device_scale_factor();
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