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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2739113002: Simplify calls for scale factor (Closed)
Patch Set: nit 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: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 1000c12f3f4f68d67ca1f1d5ad571e50f92963a4..b4dc9e9c7a5bf097f8290a2430306bb82bbfb72e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -82,7 +82,6 @@
#include "ui/base/ui_base_types.h"
#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/compositor/dip_util.h"
-#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/blink/web_input_event.h"
@@ -439,9 +438,7 @@ void RenderWidgetHostViewAura::InitAsChild(
if (parent_view)
parent_view->AddChild(GetNativeView());
- const display::Display display =
- display::Screen::GetScreen()->GetDisplayNearestWindow(window_);
- device_scale_factor_ = display.device_scale_factor();
+ device_scale_factor_ = ui::GetScaleFactorForNativeView(window_);
}
void RenderWidgetHostViewAura::InitAsPopup(
@@ -490,9 +487,7 @@ void RenderWidgetHostViewAura::InitAsPopup(
event_filter_for_popup_exit_.reset(new EventFilterForPopupExit(this));
- const display::Display display =
- display::Screen::GetScreen()->GetDisplayNearestWindow(window_);
- device_scale_factor_ = display.device_scale_factor();
+ device_scale_factor_ = ui::GetScaleFactorForNativeView(window_);
}
void RenderWidgetHostViewAura::InitAsFullscreen(
@@ -517,9 +512,7 @@ void RenderWidgetHostViewAura::InitAsFullscreen(
Show();
Focus();
- const display::Display display =
- display::Screen::GetScreen()->GetDisplayNearestWindow(window_);
- device_scale_factor_ = display.device_scale_factor();
+ device_scale_factor_ = ui::GetScaleFactorForNativeView(window_);
}
RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const {

Powered by Google App Engine
This is Rietveld 408576698