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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "ui/base/ui_base_types.h" | 60 #include "ui/base/ui_base_types.h" |
61 #include "ui/compositor/layer.h" | 61 #include "ui/compositor/layer.h" |
62 #include "ui/gfx/canvas.h" | 62 #include "ui/gfx/canvas.h" |
63 #include "ui/gfx/display.h" | 63 #include "ui/gfx/display.h" |
64 #include "ui/gfx/rect_conversions.h" | 64 #include "ui/gfx/rect_conversions.h" |
65 #include "ui/gfx/screen.h" | 65 #include "ui/gfx/screen.h" |
66 #include "ui/gfx/size_conversions.h" | 66 #include "ui/gfx/size_conversions.h" |
67 #include "ui/gfx/skia_util.h" | 67 #include "ui/gfx/skia_util.h" |
68 | 68 |
69 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
| 70 #include "base/win/windows_version.h" |
70 #include "content/browser/accessibility/browser_accessibility_manager_win.h" | 71 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
71 #include "content/browser/accessibility/browser_accessibility_win.h" | 72 #include "content/browser/accessibility/browser_accessibility_win.h" |
72 #include "ui/base/win/hidden_window.h" | 73 #include "ui/base/win/hidden_window.h" |
73 #include "ui/gfx/gdi_util.h" | 74 #include "ui/gfx/gdi_util.h" |
74 #endif | 75 #endif |
75 | 76 |
76 using gfx::RectToSkIRect; | 77 using gfx::RectToSkIRect; |
77 using gfx::SkIRectToRect; | 78 using gfx::SkIRectToRect; |
78 | 79 |
79 using WebKit::WebScreenInfo; | 80 using WebKit::WebScreenInfo; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 gfx::Screen::GetScreenFor(window)->GetPrimaryDisplay(); | 259 gfx::Screen::GetScreenFor(window)->GetPrimaryDisplay(); |
259 results->rect = display.bounds(); | 260 results->rect = display.bounds(); |
260 results->availableRect = display.work_area(); | 261 results->availableRect = display.work_area(); |
261 // TODO(derat|oshima): Don't hardcode this. Get this from display object. | 262 // TODO(derat|oshima): Don't hardcode this. Get this from display object. |
262 results->depth = 24; | 263 results->depth = 24; |
263 results->depthPerComponent = 8; | 264 results->depthPerComponent = 8; |
264 results->deviceScaleFactor = display.device_scale_factor(); | 265 results->deviceScaleFactor = display.device_scale_factor(); |
265 } | 266 } |
266 | 267 |
267 bool ShouldSendPinchGesture() { | 268 bool ShouldSendPinchGesture() { |
| 269 #if defined(OS_WIN) |
| 270 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
| 271 return true; |
| 272 #endif |
268 static bool pinch_allowed = | 273 static bool pinch_allowed = |
269 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) || | 274 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViewport) || |
270 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); | 275 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePinch); |
271 return pinch_allowed; | 276 return pinch_allowed; |
272 } | 277 } |
273 | 278 |
274 bool PointerEventActivates(const ui::Event& event) { | 279 bool PointerEventActivates(const ui::Event& event) { |
275 if (event.type() == ui::ET_MOUSE_PRESSED) | 280 if (event.type() == ui::ET_MOUSE_PRESSED) |
276 return true; | 281 return true; |
277 | 282 |
(...skipping 2391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 RenderWidgetHost* widget) { | 2674 RenderWidgetHost* widget) { |
2670 return new RenderWidgetHostViewAura(widget); | 2675 return new RenderWidgetHostViewAura(widget); |
2671 } | 2676 } |
2672 | 2677 |
2673 // static | 2678 // static |
2674 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 2679 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
2675 GetScreenInfoForWindow(results, NULL); | 2680 GetScreenInfoForWindow(results, NULL); |
2676 } | 2681 } |
2677 | 2682 |
2678 } // namespace content | 2683 } // namespace content |
OLD | NEW |