| 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/browser/power_save_blocker_factory.h" | |
| 86 #include "device/power_save_blocker/power_save_blocker.h" | 85 #include "device/power_save_blocker/power_save_blocker.h" |
| 87 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" | 86 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" |
| 88 #endif | 87 #endif |
| 89 | 88 |
| 90 using base::Time; | 89 using base::Time; |
| 91 using base::TimeDelta; | 90 using base::TimeDelta; |
| 92 using base::TimeTicks; | 91 using base::TimeTicks; |
| 93 using blink::WebGestureEvent; | 92 using blink::WebGestureEvent; |
| 94 using blink::WebInputEvent; | 93 using blink::WebInputEvent; |
| 95 using blink::WebKeyboardEvent; | 94 using blink::WebKeyboardEvent; |
| (...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 const GetSnapshotFromBrowserCallback& callback) { | 1287 const GetSnapshotFromBrowserCallback& callback) { |
| 1289 int id = next_browser_snapshot_id_++; | 1288 int id = next_browser_snapshot_id_++; |
| 1290 | 1289 |
| 1291 #if defined(OS_MACOSX) | 1290 #if defined(OS_MACOSX) |
| 1292 // MacOS version of underlying GrabViewSnapshot() blocks while | 1291 // MacOS version of underlying GrabViewSnapshot() blocks while |
| 1293 // display/GPU are in a power-saving mode, so make sure display | 1292 // 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. | 1293 // does not go to sleep for the duration of reading a snapshot. |
| 1295 if (pending_browser_snapshots_.empty()) { | 1294 if (pending_browser_snapshots_.empty()) { |
| 1296 DCHECK(!power_save_blocker_); | 1295 DCHECK(!power_save_blocker_); |
| 1297 power_save_blocker_.reset( | 1296 power_save_blocker_.reset( |
| 1298 CreatePowerSaveBlocker( | 1297 device::PowerSaveBlocker::CreateWithTaskRunners( |
| 1299 device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 1298 device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
| 1300 device::PowerSaveBlocker::kReasonOther, "GetSnapshot") | 1299 device::PowerSaveBlocker::kReasonOther, "GetSnapshot", |
| 1300 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 1301 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)) |
| 1301 .release()); | 1302 .release()); |
| 1302 } | 1303 } |
| 1303 #endif | 1304 #endif |
| 1304 pending_browser_snapshots_.insert(std::make_pair(id, callback)); | 1305 pending_browser_snapshots_.insert(std::make_pair(id, callback)); |
| 1305 Send(new ViewMsg_ForceRedraw(GetRoutingID(), id)); | 1306 Send(new ViewMsg_ForceRedraw(GetRoutingID(), id)); |
| 1306 } | 1307 } |
| 1307 | 1308 |
| 1308 const NativeWebKeyboardEvent* | 1309 const NativeWebKeyboardEvent* |
| 1309 RenderWidgetHostImpl::GetLastKeyboardEvent() const { | 1310 RenderWidgetHostImpl::GetLastKeyboardEvent() const { |
| 1310 return input_router_->GetLastKeyboardEvent(); | 1311 return input_router_->GetLastKeyboardEvent(); |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2200 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2201 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
| 2201 } | 2202 } |
| 2202 | 2203 |
| 2203 BrowserAccessibilityManager* | 2204 BrowserAccessibilityManager* |
| 2204 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2205 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
| 2205 return delegate_ ? | 2206 return delegate_ ? |
| 2206 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2207 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
| 2207 } | 2208 } |
| 2208 | 2209 |
| 2209 } // namespace content | 2210 } // namespace content |
| OLD | NEW |