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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "skia/ext/image_operations.h" | 53 #include "skia/ext/image_operations.h" |
54 #include "skia/ext/platform_canvas.h" | 54 #include "skia/ext/platform_canvas.h" |
55 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 55 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
56 #include "ui/base/events/event.h" | 56 #include "ui/base/events/event.h" |
57 #include "ui/base/keycodes/keyboard_codes.h" | 57 #include "ui/base/keycodes/keyboard_codes.h" |
58 #include "ui/gfx/size_conversions.h" | 58 #include "ui/gfx/size_conversions.h" |
59 #include "ui/gfx/skbitmap_operations.h" | 59 #include "ui/gfx/skbitmap_operations.h" |
60 #include "ui/gfx/vector2d_conversions.h" | 60 #include "ui/gfx/vector2d_conversions.h" |
61 #include "webkit/common/cursors/webcursor.h" | 61 #include "webkit/common/cursors/webcursor.h" |
62 #include "webkit/common/webpreferences.h" | 62 #include "webkit/common/webpreferences.h" |
63 #include "webkit/plugins/npapi/webplugin.h" | 63 #include "webkit/plugins/npapi/plugin_utils.h" |
64 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | |
65 | 64 |
66 #if defined(TOOLKIT_GTK) | 65 #if defined(TOOLKIT_GTK) |
67 #include "content/browser/renderer_host/backing_store_gtk.h" | 66 #include "content/browser/renderer_host/backing_store_gtk.h" |
68 #elif defined(OS_MACOSX) | 67 #elif defined(OS_MACOSX) |
69 #include "content/browser/renderer_host/backing_store_mac.h" | 68 #include "content/browser/renderer_host/backing_store_mac.h" |
70 #endif | 69 #endif |
71 | 70 |
72 using base::Time; | 71 using base::Time; |
73 using base::TimeDelta; | 72 using base::TimeDelta; |
74 using base::TimeTicks; | 73 using base::TimeTicks; |
75 using webkit::npapi::WebPluginDelegateImpl; | |
76 using WebKit::WebGestureEvent; | 74 using WebKit::WebGestureEvent; |
77 using WebKit::WebInputEvent; | 75 using WebKit::WebInputEvent; |
78 using WebKit::WebKeyboardEvent; | 76 using WebKit::WebKeyboardEvent; |
79 using WebKit::WebMouseEvent; | 77 using WebKit::WebMouseEvent; |
80 using WebKit::WebMouseWheelEvent; | 78 using WebKit::WebMouseWheelEvent; |
81 using WebKit::WebTextDirection; | 79 using WebKit::WebTextDirection; |
82 | 80 |
83 namespace content { | 81 namespace content { |
84 namespace { | 82 namespace { |
85 | 83 |
(...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2224 | 2222 |
2225 zoomed_bitmap.setPixels(0); | 2223 zoomed_bitmap.setPixels(0); |
2226 Send(new ViewMsg_ReleaseDisambiguationPopupDIB(GetRoutingID(), | 2224 Send(new ViewMsg_ReleaseDisambiguationPopupDIB(GetRoutingID(), |
2227 dib->handle())); | 2225 dib->handle())); |
2228 } | 2226 } |
2229 | 2227 |
2230 #if defined(OS_WIN) | 2228 #if defined(OS_WIN) |
2231 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( | 2229 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowCreated( |
2232 gfx::NativeViewId dummy_activation_window) { | 2230 gfx::NativeViewId dummy_activation_window) { |
2233 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); | 2231 HWND hwnd = reinterpret_cast<HWND>(dummy_activation_window); |
2234 if (!IsWindow(hwnd) || | 2232 if (!IsWindow(hwnd) || !webkit::npapi::IsDummyActivationWindow(hwnd)) { |
2235 !WebPluginDelegateImpl::IsDummyActivationWindow(hwnd)) { | |
2236 // This may happen as a result of a race condition when the plugin is going | 2233 // This may happen as a result of a race condition when the plugin is going |
2237 // away. | 2234 // away. |
2238 return; | 2235 return; |
2239 } | 2236 } |
2240 | 2237 |
2241 SetParent(hwnd, reinterpret_cast<HWND>(GetNativeViewId())); | 2238 SetParent(hwnd, reinterpret_cast<HWND>(GetNativeViewId())); |
2242 dummy_windows_for_activation_.push_back(hwnd); | 2239 dummy_windows_for_activation_.push_back(hwnd); |
2243 } | 2240 } |
2244 | 2241 |
2245 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowDestroyed( | 2242 void RenderWidgetHostImpl::OnWindowlessPluginDummyWindowDestroyed( |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2586 if (!is_threaded_compositing_enabled_) | 2583 if (!is_threaded_compositing_enabled_) |
2587 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); | 2584 Send(new ViewMsg_SwapBuffers_ACK(routing_id_)); |
2588 } | 2585 } |
2589 | 2586 |
2590 #if defined(USE_AURA) | 2587 #if defined(USE_AURA) |
2591 | 2588 |
2592 void RenderWidgetHostImpl::ParentChanged(gfx::NativeViewId new_parent) { | 2589 void RenderWidgetHostImpl::ParentChanged(gfx::NativeViewId new_parent) { |
2593 #if defined(OS_WIN) | 2590 #if defined(OS_WIN) |
2594 HWND hwnd = reinterpret_cast<HWND>(new_parent); | 2591 HWND hwnd = reinterpret_cast<HWND>(new_parent); |
2595 if (!hwnd) | 2592 if (!hwnd) |
2596 hwnd = WebPluginDelegateImpl::GetDefaultWindowParent(); | 2593 hwnd = webkit::npapi::GetDefaultWindowParent(); |
2597 for (std::list<HWND>::iterator i = dummy_windows_for_activation_.begin(); | 2594 for (std::list<HWND>::iterator i = dummy_windows_for_activation_.begin(); |
2598 i != dummy_windows_for_activation_.end(); ++i) { | 2595 i != dummy_windows_for_activation_.end(); ++i) { |
2599 SetParent(*i, hwnd); | 2596 SetParent(*i, hwnd); |
2600 } | 2597 } |
2601 #endif | 2598 #endif |
2602 } | 2599 } |
2603 | 2600 |
2604 #endif | 2601 #endif |
2605 | 2602 |
2606 void RenderWidgetHostImpl::DelayedAutoResized() { | 2603 void RenderWidgetHostImpl::DelayedAutoResized() { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2725 int process_id = (b->first.second >> 32) & 0xffffffff; | 2722 int process_id = (b->first.second >> 32) & 0xffffffff; |
2726 RenderWidgetHost* rwh = | 2723 RenderWidgetHost* rwh = |
2727 RenderWidgetHost::FromID(process_id, routing_id); | 2724 RenderWidgetHost::FromID(process_id, routing_id); |
2728 if (!rwh) | 2725 if (!rwh) |
2729 continue; | 2726 continue; |
2730 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); | 2727 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); |
2731 } | 2728 } |
2732 } | 2729 } |
2733 | 2730 |
2734 } // namespace content | 2731 } // namespace content |
OLD | NEW |