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

Side by Side 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: . 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 1282
1283 // static 1283 // static
1284 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( 1284 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
1285 RenderWidgetHost* widget) { 1285 RenderWidgetHost* widget) {
1286 return new RenderWidgetHostViewAura(widget); 1286 return new RenderWidgetHostViewAura(widget);
1287 } 1287 }
1288 1288
1289 // static 1289 // static
1290 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( 1290 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo(
1291 WebKit::WebScreenInfo* results) { 1291 WebKit::WebScreenInfo* results) {
1292 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); 1292 const gfx::Size size = gfx::Screen::GetPrimaryMonitorBounds().size();
1293 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); 1293 results->rect = WebKit::WebRect(0, 0, size.width(), size.height());
1294 results->availableRect = results->rect; 1294 results->availableRect = results->rect;
1295 // TODO(derat): Don't hardcode this? 1295 // TODO(derat): Don't hardcode this?
1296 results->depth = 24; 1296 results->depth = 24;
1297 results->depthPerComponent = 8; 1297 results->depthPerComponent = 8;
1298 // TODO(fsamuel): This is a temporary hack until Monitor code is complete. 1298 // TODO(fsamuel): This is a temporary hack until Monitor code is complete.
1299 int default_dpi = 96; 1299 int default_dpi = 96;
1300 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 1300 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1301 if (command_line.HasSwitch(switches::kDefaultDeviceScaleFactor)) { 1301 if (command_line.HasSwitch(switches::kDefaultDeviceScaleFactor)) {
1302 int default_device_scale_factor; 1302 int default_device_scale_factor;
1303 base::StringToInt(command_line.GetSwitchValueASCII( 1303 base::StringToInt(command_line.GetSwitchValueASCII(
1304 switches::kDefaultDeviceScaleFactor), 1304 switches::kDefaultDeviceScaleFactor),
1305 &default_device_scale_factor); 1305 &default_device_scale_factor);
1306 default_dpi = default_device_scale_factor * 160; 1306 default_dpi = default_device_scale_factor * 160;
1307 } 1307 }
1308 results->verticalDPI = default_dpi; 1308 results->verticalDPI = default_dpi;
1309 results->horizontalDPI = default_dpi; 1309 results->horizontalDPI = default_dpi;
1310 } 1310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698