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

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

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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 789b9dbe7e6232a71621c98a2e47560737570efa..f21e8f91f8cc666e7f21e7a4f95a9c321373cae5 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -27,8 +27,6 @@
#include "ui/aura/client/window_types.h"
#include "ui/aura/env.h"
#include "ui/aura/event.h"
-#include "ui/aura/monitor.h"
-#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
@@ -39,6 +37,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/compositor/layer.h"
+#include "ui/gfx/monitor.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/skia_util.h"
@@ -120,20 +119,17 @@ content::GLHelper* CreateGLHelper(ui::Compositor* compositor) {
}
void GetScreenInfoForWindow(WebKit::WebScreenInfo* results,
- const aura::Window* window) {
- aura::MonitorManager* monitor_manager =
- aura::Env::GetInstance()->monitor_manager();
- const aura::Monitor* monitor = window ?
- monitor_manager->GetMonitorNearestWindow(window) :
- monitor_manager->GetMonitorAt(0);
-
- const gfx::Size size = monitor->size();
+ aura::Window* window) {
+ const gfx::Monitor monitor = window ?
+ gfx::Screen::GetMonitorNearestWindow(window) :
+ gfx::Screen::GetPrimaryMonitor();
+ const gfx::Size size = monitor.size();
results->rect = WebKit::WebRect(0, 0, size.width(), size.height());
results->availableRect = results->rect;
// TODO(derat): Don't hardcode this?
results->depth = 24;
results->depthPerComponent = 8;
- int default_dpi = monitor->GetDeviceScaleFactor() * 160;
+ int default_dpi = monitor.device_scale_factor() * 160;
// TODO(fsamuel): This is a temporary hack until Monitor code is complete.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kDefaultDeviceScaleFactor)) {
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.cc ('k') | content/browser/renderer_host/render_widget_host_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698