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/browser_plugin/browser_plugin_embedder.h" | 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
9 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 9 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
11 #include "content/browser/web_contents/web_contents_impl.h" | 11 #include "content/browser/web_contents/web_contents_impl.h" |
12 #include "content/common/browser_plugin/browser_plugin_constants.h" | 12 #include "content/common/browser_plugin/browser_plugin_constants.h" |
13 #include "content/common/browser_plugin/browser_plugin_messages.h" | 13 #include "content/common/browser_plugin/browser_plugin_messages.h" |
14 #include "content/common/drag_messages.h" | 14 #include "content/common/drag_messages.h" |
15 #include "content/common/gpu/gpu_messages.h" | 15 #include "content/common/gpu/gpu_messages.h" |
16 #include "content/public/browser/browser_context.h" | 16 #include "content/public/browser/browser_context.h" |
17 #include "content/public/browser/browser_plugin_guest_manager_delegate.h" | 17 #include "content/public/browser/browser_plugin_guest_manager.h" |
18 #include "content/public/browser/content_browser_client.h" | 18 #include "content/public/browser/content_browser_client.h" |
19 #include "content/public/browser/native_web_keyboard_event.h" | 19 #include "content/public/browser/native_web_keyboard_event.h" |
20 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
21 #include "content/public/browser/user_metrics.h" | 21 #include "content/public/browser/user_metrics.h" |
22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
23 #include "content/public/common/result_codes.h" | 23 #include "content/public/common/result_codes.h" |
24 #include "content/public/common/url_constants.h" | 24 #include "content/public/common/url_constants.h" |
25 #include "net/base/escape.h" | 25 #include "net/base/escape.h" |
26 #include "ui/events/keycodes/keyboard_codes.h" | 26 #include "ui/events/keycodes/keyboard_codes.h" |
27 | 27 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 void BrowserPluginEmbedder::StartDrag(BrowserPluginGuest* guest) { | 61 void BrowserPluginEmbedder::StartDrag(BrowserPluginGuest* guest) { |
62 guest_started_drag_ = guest->AsWeakPtr(); | 62 guest_started_drag_ = guest->AsWeakPtr(); |
63 } | 63 } |
64 | 64 |
65 WebContentsImpl* BrowserPluginEmbedder::GetWebContents() const { | 65 WebContentsImpl* BrowserPluginEmbedder::GetWebContents() const { |
66 return static_cast<WebContentsImpl*>(web_contents()); | 66 return static_cast<WebContentsImpl*>(web_contents()); |
67 } | 67 } |
68 | 68 |
69 BrowserPluginGuestManagerDelegate* | 69 BrowserPluginGuestManager* |
70 BrowserPluginEmbedder::GetBrowserPluginGuestManager() const { | 70 BrowserPluginEmbedder::GetBrowserPluginGuestManager() const { |
71 return GetWebContents()->GetBrowserContext()->GetGuestManagerDelegate(); | 71 return GetWebContents()->GetBrowserContext()->GetGuestManager(); |
72 } | 72 } |
73 | 73 |
74 bool BrowserPluginEmbedder::DidSendScreenRectsCallback( | 74 bool BrowserPluginEmbedder::DidSendScreenRectsCallback( |
75 WebContents* guest_web_contents) { | 75 WebContents* guest_web_contents) { |
76 static_cast<RenderViewHostImpl*>( | 76 static_cast<RenderViewHostImpl*>( |
77 guest_web_contents->GetRenderViewHost())->SendScreenRects(); | 77 guest_web_contents->GetRenderViewHost())->SendScreenRects(); |
78 // Not handled => Iterate over all guests. | 78 // Not handled => Iterate over all guests. |
79 return false; | 79 return false; |
80 } | 80 } |
81 | 81 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( | 216 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( |
217 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), | 217 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), |
218 base::Bind(&BrowserPluginEmbedder::OnGuestCallback, | 218 base::Bind(&BrowserPluginEmbedder::OnGuestCallback, |
219 base::Unretained(this), | 219 base::Unretained(this), |
220 instance_id, | 220 instance_id, |
221 params, | 221 params, |
222 &extra_params)); | 222 &extra_params)); |
223 } | 223 } |
224 | 224 |
225 } // namespace content | 225 } // namespace content |
OLD | NEW |