| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "ui/gfx/geometry/size_conversions.h" | 72 #include "ui/gfx/geometry/size_conversions.h" |
| 73 #include "ui/gfx/geometry/vector2d_conversions.h" | 73 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 74 #include "ui/gfx/skbitmap_operations.h" | 74 #include "ui/gfx/skbitmap_operations.h" |
| 75 #include "ui/snapshot/snapshot.h" | 75 #include "ui/snapshot/snapshot.h" |
| 76 | 76 |
| 77 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
| 78 #include "content/common/plugin_constants_win.h" | 78 #include "content/common/plugin_constants_win.h" |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 #if defined(OS_MACOSX) | 81 #if defined(OS_MACOSX) |
| 82 #include "content/browser/renderer_host/render_widget_resize_helper_mac.h" | 82 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 using base::Time; | 85 using base::Time; |
| 86 using base::TimeDelta; | 86 using base::TimeDelta; |
| 87 using base::TimeTicks; | 87 using base::TimeTicks; |
| 88 using blink::WebGestureEvent; | 88 using blink::WebGestureEvent; |
| 89 using blink::WebInputEvent; | 89 using blink::WebInputEvent; |
| 90 using blink::WebKeyboardEvent; | 90 using blink::WebKeyboardEvent; |
| 91 using blink::WebMouseEvent; | 91 using blink::WebMouseEvent; |
| 92 using blink::WebMouseWheelEvent; | 92 using blink::WebMouseWheelEvent; |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 Send(new ViewMsg_Repaint(routing_id_, view_size)); | 856 Send(new ViewMsg_Repaint(routing_id_, view_size)); |
| 857 } | 857 } |
| 858 | 858 |
| 859 // Pump a nested message loop until we time out or get a frame of the right | 859 // Pump a nested message loop until we time out or get a frame of the right |
| 860 // size. | 860 // size. |
| 861 TimeTicks start_time = TimeTicks::Now(); | 861 TimeTicks start_time = TimeTicks::Now(); |
| 862 TimeDelta time_left = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); | 862 TimeDelta time_left = TimeDelta::FromMilliseconds(kPaintMsgTimeoutMS); |
| 863 TimeTicks timeout_time = start_time + time_left; | 863 TimeTicks timeout_time = start_time + time_left; |
| 864 while (1) { | 864 while (1) { |
| 865 TRACE_EVENT0("renderer_host", "WaitForSurface::WaitForSingleTaskToRun"); | 865 TRACE_EVENT0("renderer_host", "WaitForSurface::WaitForSingleTaskToRun"); |
| 866 if (RenderWidgetResizeHelper::Get()->WaitForSingleTaskToRun(time_left)) { | 866 if (ui::WindowResizeHelperMac::Get()->WaitForSingleTaskToRun(time_left)) { |
| 867 // For auto-resized views, current_size_ determines the view_size and it | 867 // For auto-resized views, current_size_ determines the view_size and it |
| 868 // may have changed during the handling of an UpdateRect message. | 868 // may have changed during the handling of an UpdateRect message. |
| 869 if (auto_resize_enabled_) | 869 if (auto_resize_enabled_) |
| 870 view_size = current_size_; | 870 view_size = current_size_; |
| 871 if (view_->HasAcceleratedSurface(view_size)) | 871 if (view_->HasAcceleratedSurface(view_size)) |
| 872 break; | 872 break; |
| 873 } | 873 } |
| 874 time_left = timeout_time - TimeTicks::Now(); | 874 time_left = timeout_time - TimeTicks::Now(); |
| 875 if (time_left <= TimeDelta::FromSeconds(0)) { | 875 if (time_left <= TimeDelta::FromSeconds(0)) { |
| 876 TRACE_EVENT0("renderer_host", "WaitForSurface::Timeout"); | 876 TRACE_EVENT0("renderer_host", "WaitForSurface::Timeout"); |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 } | 2159 } |
| 2160 | 2160 |
| 2161 #if defined(OS_WIN) | 2161 #if defined(OS_WIN) |
| 2162 gfx::NativeViewAccessible | 2162 gfx::NativeViewAccessible |
| 2163 RenderWidgetHostImpl::GetParentNativeViewAccessible() { | 2163 RenderWidgetHostImpl::GetParentNativeViewAccessible() { |
| 2164 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; | 2164 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; |
| 2165 } | 2165 } |
| 2166 #endif | 2166 #endif |
| 2167 | 2167 |
| 2168 } // namespace content | 2168 } // namespace content |
| OLD | NEW |