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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "ui/aura/root_window.h" | 34 #include "ui/aura/root_window.h" |
35 #include "ui/aura/window.h" | 35 #include "ui/aura/window.h" |
36 #include "ui/aura/window_observer.h" | 36 #include "ui/aura/window_observer.h" |
37 #include "ui/base/gestures/gesture_recognizer.h" | 37 #include "ui/base/gestures/gesture_recognizer.h" |
38 #include "ui/base/hit_test.h" | 38 #include "ui/base/hit_test.h" |
39 #include "ui/base/ime/input_method.h" | 39 #include "ui/base/ime/input_method.h" |
40 #include "ui/base/ui_base_types.h" | 40 #include "ui/base/ui_base_types.h" |
41 #include "ui/compositor/compositor.h" | 41 #include "ui/compositor/compositor.h" |
42 #include "ui/compositor/layer.h" | 42 #include "ui/compositor/layer.h" |
43 #include "ui/gfx/canvas.h" | 43 #include "ui/gfx/canvas.h" |
44 #include "ui/gfx/monitor.h" | 44 #include "ui/gfx/display.h" |
45 #include "ui/gfx/screen.h" | 45 #include "ui/gfx/screen.h" |
46 #include "ui/gfx/skia_util.h" | 46 #include "ui/gfx/skia_util.h" |
47 | 47 |
48 using content::BrowserThread; | 48 using content::BrowserThread; |
49 using content::NativeWebKeyboardEvent; | 49 using content::NativeWebKeyboardEvent; |
50 using content::RenderWidgetHost; | 50 using content::RenderWidgetHost; |
51 using content::RenderWidgetHostImpl; | 51 using content::RenderWidgetHostImpl; |
52 using content::RenderWidgetHostView; | 52 using content::RenderWidgetHostView; |
53 using WebKit::WebTouchEvent; | 53 using WebKit::WebTouchEvent; |
54 | 54 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 return false; | 106 return false; |
107 default: | 107 default: |
108 break; | 108 break; |
109 } | 109 } |
110 #endif | 110 #endif |
111 return true; | 111 return true; |
112 } | 112 } |
113 | 113 |
114 void GetScreenInfoForWindow(WebKit::WebScreenInfo* results, | 114 void GetScreenInfoForWindow(WebKit::WebScreenInfo* results, |
115 aura::Window* window) { | 115 aura::Window* window) { |
116 const gfx::Monitor monitor = window ? | 116 const gfx::Display display = window ? |
117 gfx::Screen::GetMonitorNearestWindow(window) : | 117 gfx::Screen::GetMonitorNearestWindow(window) : |
118 gfx::Screen::GetPrimaryMonitor(); | 118 gfx::Screen::GetPrimaryMonitor(); |
119 const gfx::Size size = monitor.size(); | 119 const gfx::Size size = display.size(); |
120 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 120 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
121 results->availableRect = results->rect; | 121 results->availableRect = results->rect; |
122 // TODO(derat|oshima): Don't hardcode this. Get this from monitor object. | 122 // TODO(derat|oshima): Don't hardcode this. Get this from display object. |
123 results->depth = 24; | 123 results->depth = 24; |
124 results->depthPerComponent = 8; | 124 results->depthPerComponent = 8; |
125 int default_dpi = monitor.device_scale_factor() * 160; | 125 int default_dpi = display.device_scale_factor() * 160; |
126 results->verticalDPI = default_dpi; | 126 results->verticalDPI = default_dpi; |
127 results->horizontalDPI = default_dpi; | 127 results->horizontalDPI = default_dpi; |
128 } | 128 } |
129 | 129 |
130 bool ShouldSendPinchGesture() { | 130 bool ShouldSendPinchGesture() { |
131 static bool pinch_allowed = | 131 static bool pinch_allowed = |
132 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) || | 132 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) || |
133 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); | 133 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); |
134 return pinch_allowed; | 134 return pinch_allowed; |
135 } | 135 } |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1342 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1343 RenderWidgetHost* widget) { | 1343 RenderWidgetHost* widget) { |
1344 return new RenderWidgetHostViewAura(widget); | 1344 return new RenderWidgetHostViewAura(widget); |
1345 } | 1345 } |
1346 | 1346 |
1347 // static | 1347 // static |
1348 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1348 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1349 WebKit::WebScreenInfo* results) { | 1349 WebKit::WebScreenInfo* results) { |
1350 GetScreenInfoForWindow(results, NULL); | 1350 GetScreenInfoForWindow(results, NULL); |
1351 } | 1351 } |
OLD | NEW |