| 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 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 #include "ui/gfx/geometry/size_conversions.h" | 71 #include "ui/gfx/geometry/size_conversions.h" |
| 72 #include "ui/gfx/geometry/vector2d_conversions.h" | 72 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 73 #include "ui/gfx/skbitmap_operations.h" | 73 #include "ui/gfx/skbitmap_operations.h" |
| 74 #include "ui/snapshot/snapshot.h" | 74 #include "ui/snapshot/snapshot.h" |
| 75 | 75 |
| 76 #if defined(OS_WIN) | 76 #if defined(OS_WIN) |
| 77 #include "content/common/plugin_constants_win.h" | 77 #include "content/common/plugin_constants_win.h" |
| 78 #endif | 78 #endif |
| 79 | 79 |
| 80 #if defined(OS_MACOSX) | 80 #if defined(OS_MACOSX) |
| 81 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" | 81 #include "ui/base/window_resize_helper.h" |
| 82 #endif | 82 #endif |
| 83 | 83 |
| 84 using base::Time; | 84 using base::Time; |
| 85 using base::TimeDelta; | 85 using base::TimeDelta; |
| 86 using base::TimeTicks; | 86 using base::TimeTicks; |
| 87 using blink::WebGestureEvent; | 87 using blink::WebGestureEvent; |
| 88 using blink::WebInputEvent; | 88 using blink::WebInputEvent; |
| 89 using blink::WebKeyboardEvent; | 89 using blink::WebKeyboardEvent; |
| 90 using blink::WebMouseEvent; | 90 using blink::WebMouseEvent; |
| 91 using blink::WebMouseWheelEvent; | 91 using blink::WebMouseWheelEvent; |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 Send(new ViewMsg_Repaint(routing_id_, view_size)); | 893 Send(new ViewMsg_Repaint(routing_id_, view_size)); |
| 894 } | 894 } |
| 895 | 895 |
| 896 // Pump a nested message loop until we time out or get a frame of the right | 896 // Pump a nested message loop until we time out or get a frame of the right |
| 897 // size. | 897 // size. |
| 898 TimeTicks start_time = TimeTicks::Now(); | 898 TimeTicks start_time = TimeTicks::Now(); |
| 899 TimeDelta time_left = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); | 899 TimeDelta time_left = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); |
| 900 TimeTicks timeout_time = start_time + time_left; | 900 TimeTicks timeout_time = start_time + time_left; |
| 901 while (1) { | 901 while (1) { |
| 902 TRACE_EVENT0("renderer_host", "WaitForSurface::WaitForSingleTaskToRun"); | 902 TRACE_EVENT0("renderer_host", "WaitForSurface::WaitForSingleTaskToRun"); |
| 903 if (ui::WindowResizeHelperMac::Get()->WaitForSingleTaskToRun(time_left)) { | 903 if (ui::WindowResizeHelper::Get()->WaitForSingleTaskToRun(time_left)) { |
| 904 // For auto-resized views, current_size_ determines the view_size and it | 904 // For auto-resized views, current_size_ determines the view_size and it |
| 905 // may have changed during the handling of an UpdateRect message. | 905 // may have changed during the handling of an UpdateRect message. |
| 906 if (auto_resize_enabled_) | 906 if (auto_resize_enabled_) |
| 907 view_size = current_size_; | 907 view_size = current_size_; |
| 908 if (view_->HasAcceleratedSurface(view_size)) | 908 if (view_->HasAcceleratedSurface(view_size)) |
| 909 break; | 909 break; |
| 910 } | 910 } |
| 911 time_left = timeout_time - TimeTicks::Now(); | 911 time_left = timeout_time - TimeTicks::Now(); |
| 912 if (time_left <= TimeDelta::FromSeconds(0)) { | 912 if (time_left <= TimeDelta::FromSeconds(0)) { |
| 913 TRACE_EVENT0("renderer_host", "WaitForSurface::Timeout"); | 913 TRACE_EVENT0("renderer_host", "WaitForSurface::Timeout"); |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 } | 2241 } |
| 2242 | 2242 |
| 2243 #if defined(OS_WIN) | 2243 #if defined(OS_WIN) |
| 2244 gfx::NativeViewAccessible | 2244 gfx::NativeViewAccessible |
| 2245 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2245 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
| 2246 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2246 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
| 2247 } | 2247 } |
| 2248 #endif | 2248 #endif |
| 2249 | 2249 |
| 2250 } // namespace content | 2250 } // namespace content |
| OLD | NEW |