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_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "skia/ext/platform_canvas.h" | 75 #include "skia/ext/platform_canvas.h" |
76 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 76 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
77 #include "ui/events/event.h" | 77 #include "ui/events/event.h" |
78 #include "ui/events/keycodes/keyboard_codes.h" | 78 #include "ui/events/keycodes/keyboard_codes.h" |
79 #include "ui/gfx/geometry/size_conversions.h" | 79 #include "ui/gfx/geometry/size_conversions.h" |
80 #include "ui/gfx/geometry/vector2d_conversions.h" | 80 #include "ui/gfx/geometry/vector2d_conversions.h" |
81 #include "ui/gfx/skbitmap_operations.h" | 81 #include "ui/gfx/skbitmap_operations.h" |
82 #include "ui/snapshot/snapshot.h" | 82 #include "ui/snapshot/snapshot.h" |
83 | 83 |
84 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
85 #include "content/public/browser/power_save_blocker.h" | 85 #include "content/browser/power_save_blocker_factory.h" |
86 #include "content/public/browser/power_save_blocker_factory.h" | 86 #include "device/power_save_blocker/power_save_blocker.h" |
87 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" | 87 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" |
88 #endif | 88 #endif |
89 | 89 |
90 using base::Time; | 90 using base::Time; |
91 using base::TimeDelta; | 91 using base::TimeDelta; |
92 using base::TimeTicks; | 92 using base::TimeTicks; |
93 using blink::WebGestureEvent; | 93 using blink::WebGestureEvent; |
94 using blink::WebInputEvent; | 94 using blink::WebInputEvent; |
95 using blink::WebKeyboardEvent; | 95 using blink::WebKeyboardEvent; |
96 using blink::WebMouseEvent; | 96 using blink::WebMouseEvent; |
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 int id = next_browser_snapshot_id_++; | 1289 int id = next_browser_snapshot_id_++; |
1290 | 1290 |
1291 #if defined(OS_MACOSX) | 1291 #if defined(OS_MACOSX) |
1292 // MacOS version of underlying GrabViewSnapshot() blocks while | 1292 // MacOS version of underlying GrabViewSnapshot() blocks while |
1293 // display/GPU are in a power-saving mode, so make sure display | 1293 // display/GPU are in a power-saving mode, so make sure display |
1294 // does not go to sleep for the duration of reading a snapshot. | 1294 // does not go to sleep for the duration of reading a snapshot. |
1295 if (pending_browser_snapshots_.empty()) { | 1295 if (pending_browser_snapshots_.empty()) { |
1296 DCHECK(!power_save_blocker_); | 1296 DCHECK(!power_save_blocker_); |
1297 power_save_blocker_.reset( | 1297 power_save_blocker_.reset( |
1298 CreatePowerSaveBlocker( | 1298 CreatePowerSaveBlocker( |
1299 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 1299 device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
1300 PowerSaveBlocker::kReasonOther, "GetSnapshot") | 1300 device::PowerSaveBlocker::kReasonOther, "GetSnapshot") |
1301 .release()); | 1301 .release()); |
1302 } | 1302 } |
1303 #endif | 1303 #endif |
1304 pending_browser_snapshots_.insert(std::make_pair(id, callback)); | 1304 pending_browser_snapshots_.insert(std::make_pair(id, callback)); |
1305 Send(new ViewMsg_ForceRedraw(GetRoutingID(), id)); | 1305 Send(new ViewMsg_ForceRedraw(GetRoutingID(), id)); |
1306 } | 1306 } |
1307 | 1307 |
1308 const NativeWebKeyboardEvent* | 1308 const NativeWebKeyboardEvent* |
1309 RenderWidgetHostImpl::GetLastKeyboardEvent() const { | 1309 RenderWidgetHostImpl::GetLastKeyboardEvent() const { |
1310 return input_router_->GetLastKeyboardEvent(); | 1310 return input_router_->GetLastKeyboardEvent(); |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2200 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2200 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
2201 } | 2201 } |
2202 | 2202 |
2203 BrowserAccessibilityManager* | 2203 BrowserAccessibilityManager* |
2204 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2204 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
2205 return delegate_ ? | 2205 return delegate_ ? |
2206 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2206 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
2207 } | 2207 } |
2208 | 2208 |
2209 } // namespace content | 2209 } // namespace content |
OLD | NEW |