| 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 int id = next_browser_snapshot_id_++; | 1290 int id = next_browser_snapshot_id_++; |
| 1291 | 1291 |
| 1292 #if defined(OS_MACOSX) | 1292 #if defined(OS_MACOSX) |
| 1293 // MacOS version of underlying GrabViewSnapshot() blocks while | 1293 // MacOS version of underlying GrabViewSnapshot() blocks while |
| 1294 // display/GPU are in a power-saving mode, so make sure display | 1294 // display/GPU are in a power-saving mode, so make sure display |
| 1295 // does not go to sleep for the duration of reading a snapshot. | 1295 // does not go to sleep for the duration of reading a snapshot. |
| 1296 if (pending_browser_snapshots_.empty()) { | 1296 if (pending_browser_snapshots_.empty()) { |
| 1297 DCHECK(!power_save_blocker_); | 1297 DCHECK(!power_save_blocker_); |
| 1298 power_save_blocker_.reset( | 1298 power_save_blocker_.reset( |
| 1299 CreatePowerSaveBlocker( | 1299 CreatePowerSaveBlocker( |
| 1300 PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, | 1300 device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, |
| 1301 PowerSaveBlocker::kReasonOther, "GetSnapshot") | 1301 device::PowerSaveBlocker::kReasonOther, "GetSnapshot") |
| 1302 .release()); | 1302 .release()); |
| 1303 } | 1303 } |
| 1304 #endif | 1304 #endif |
| 1305 pending_browser_snapshots_.insert(std::make_pair(id, callback)); | 1305 pending_browser_snapshots_.insert(std::make_pair(id, callback)); |
| 1306 Send(new ViewMsg_ForceRedraw(GetRoutingID(), id)); | 1306 Send(new ViewMsg_ForceRedraw(GetRoutingID(), id)); |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 const NativeWebKeyboardEvent* | 1309 const NativeWebKeyboardEvent* |
| 1310 RenderWidgetHostImpl::GetLastKeyboardEvent() const { | 1310 RenderWidgetHostImpl::GetLastKeyboardEvent() const { |
| 1311 return input_router_->GetLastKeyboardEvent(); | 1311 return input_router_->GetLastKeyboardEvent(); |
| (...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; | 2202 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; |
| 2203 } | 2203 } |
| 2204 | 2204 |
| 2205 BrowserAccessibilityManager* | 2205 BrowserAccessibilityManager* |
| 2206 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { | 2206 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { |
| 2207 return delegate_ ? | 2207 return delegate_ ? |
| 2208 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; | 2208 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; |
| 2209 } | 2209 } |
| 2210 | 2210 |
| 2211 } // namespace content | 2211 } // namespace content |
| OLD | NEW |