| OLD | NEW |
| 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 18 matching lines...) Expand all Loading... |
| 29 #include "ui/aura/root_window.h" | 29 #include "ui/aura/root_window.h" |
| 30 #include "ui/aura/window.h" | 30 #include "ui/aura/window.h" |
| 31 #include "ui/aura/window_observer.h" | 31 #include "ui/aura/window_observer.h" |
| 32 #include "ui/base/gestures/gesture_recognizer.h" | 32 #include "ui/base/gestures/gesture_recognizer.h" |
| 33 #include "ui/base/hit_test.h" | 33 #include "ui/base/hit_test.h" |
| 34 #include "ui/base/ime/input_method.h" | 34 #include "ui/base/ime/input_method.h" |
| 35 #include "ui/base/ui_base_types.h" | 35 #include "ui/base/ui_base_types.h" |
| 36 #include "ui/gfx/canvas.h" | 36 #include "ui/gfx/canvas.h" |
| 37 #include "ui/gfx/compositor/compositor.h" | 37 #include "ui/gfx/compositor/compositor.h" |
| 38 #include "ui/gfx/compositor/layer.h" | 38 #include "ui/gfx/compositor/layer.h" |
| 39 #include "ui/gfx/monitor.h" |
| 39 #include "ui/gfx/screen.h" | 40 #include "ui/gfx/screen.h" |
| 40 #include "ui/gfx/skia_util.h" | 41 #include "ui/gfx/skia_util.h" |
| 41 | 42 |
| 42 using content::BrowserThread; | 43 using content::BrowserThread; |
| 43 using content::RenderWidgetHost; | 44 using content::RenderWidgetHost; |
| 44 using content::RenderWidgetHostImpl; | 45 using content::RenderWidgetHostImpl; |
| 45 using content::RenderWidgetHostView; | 46 using content::RenderWidgetHostView; |
| 46 using WebKit::WebTouchEvent; | 47 using WebKit::WebTouchEvent; |
| 47 | 48 |
| 48 namespace { | 49 namespace { |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 | 1283 |
| 1283 // static | 1284 // static |
| 1284 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1285 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
| 1285 RenderWidgetHost* widget) { | 1286 RenderWidgetHost* widget) { |
| 1286 return new RenderWidgetHostViewAura(widget); | 1287 return new RenderWidgetHostViewAura(widget); |
| 1287 } | 1288 } |
| 1288 | 1289 |
| 1289 // static | 1290 // static |
| 1290 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1291 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 1291 WebKit::WebScreenInfo* results) { | 1292 WebKit::WebScreenInfo* results) { |
| 1292 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); | 1293 const gfx::Size size = gfx::Screen::GetPrimaryMonitor()->GetBounds().size(); |
| 1293 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 1294 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
| 1294 results->availableRect = results->rect; | 1295 results->availableRect = results->rect; |
| 1295 // TODO(derat): Don't hardcode this? | 1296 // TODO(derat): Don't hardcode this? |
| 1296 results->depth = 24; | 1297 results->depth = 24; |
| 1297 results->depthPerComponent = 8; | 1298 results->depthPerComponent = 8; |
| 1298 // TODO(fsamuel): This is a temporary hack until Monitor code is complete. | 1299 // TODO(fsamuel): This is a temporary hack until Monitor code is complete. |
| 1299 int default_dpi = 96; | 1300 int default_dpi = 96; |
| 1300 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1301 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 1301 if (command_line.HasSwitch(switches::kDefaultDeviceScaleFactor)) { | 1302 if (command_line.HasSwitch(switches::kDefaultDeviceScaleFactor)) { |
| 1302 int default_device_scale_factor; | 1303 int default_device_scale_factor; |
| 1303 base::StringToInt(command_line.GetSwitchValueASCII( | 1304 base::StringToInt(command_line.GetSwitchValueASCII( |
| 1304 switches::kDefaultDeviceScaleFactor), | 1305 switches::kDefaultDeviceScaleFactor), |
| 1305 &default_device_scale_factor); | 1306 &default_device_scale_factor); |
| 1306 default_dpi = default_device_scale_factor * 160; | 1307 default_dpi = default_device_scale_factor * 160; |
| 1307 } | 1308 } |
| 1308 results->verticalDPI = default_dpi; | 1309 results->verticalDPI = default_dpi; |
| 1309 results->horizontalDPI = default_dpi; | 1310 results->horizontalDPI = default_dpi; |
| 1310 } | 1311 } |
| OLD | NEW |