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/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 | 132 |
133 void BrowserPluginEmbedder::OnUpdateDragCursor(bool* handled) { | 133 void BrowserPluginEmbedder::OnUpdateDragCursor(bool* handled) { |
134 *handled = (guest_dragging_over_.get() != NULL); | 134 *handled = (guest_dragging_over_.get() != NULL); |
135 } | 135 } |
136 | 136 |
137 void BrowserPluginEmbedder::OnAttach( | 137 void BrowserPluginEmbedder::OnAttach( |
138 int browser_plugin_instance_id, | 138 int browser_plugin_instance_id, |
139 const BrowserPluginHostMsg_Attach_Params& params) { | 139 const BrowserPluginHostMsg_Attach_Params& params) { |
140 WebContents* guest_web_contents = | 140 WebContents* guest_web_contents = |
141 GetBrowserPluginGuestManager()->GetGuestByInstanceID( | 141 GetBrowserPluginGuestManager()->GetGuestByInstanceID( |
142 GetWebContents(), browser_plugin_instance_id); | 142 GetWebContents()->GetRenderProcessHost()->GetID(), |
Charlie Reis
2015/02/12 21:38:05
This won't work well with OOPIF, since a WebConten
Fady Samuel
2015/02/13 01:22:13
Done.
| |
143 browser_plugin_instance_id); | |
143 if (!guest_web_contents) | 144 if (!guest_web_contents) |
144 return; | 145 return; |
145 BrowserPluginGuest* guest = static_cast<WebContentsImpl*>(guest_web_contents) | 146 BrowserPluginGuest* guest = static_cast<WebContentsImpl*>(guest_web_contents) |
146 ->GetBrowserPluginGuest(); | 147 ->GetBrowserPluginGuest(); |
147 guest->Attach(browser_plugin_instance_id, GetWebContents(), params); | 148 guest->Attach(browser_plugin_instance_id, GetWebContents(), params); |
148 } | 149 } |
149 | 150 |
150 bool BrowserPluginEmbedder::HandleKeyboardEvent( | 151 bool BrowserPluginEmbedder::HandleKeyboardEvent( |
151 const NativeWebKeyboardEvent& event) { | 152 const NativeWebKeyboardEvent& event) { |
152 if ((event.windowsKeyCode != ui::VKEY_ESCAPE) || | 153 if ((event.windowsKeyCode != ui::VKEY_ESCAPE) || |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 if (static_cast<WebContentsImpl*>(guest)->GetBrowserPluginGuest() | 212 if (static_cast<WebContentsImpl*>(guest)->GetBrowserPluginGuest() |
212 ->StopFinding(action)) { | 213 ->StopFinding(action)) { |
213 // There can only ever currently be one browser plugin that handles find so | 214 // There can only ever currently be one browser plugin that handles find so |
214 // we can break the iteration at this point. | 215 // we can break the iteration at this point. |
215 return true; | 216 return true; |
216 } | 217 } |
217 return false; | 218 return false; |
218 } | 219 } |
219 | 220 |
220 } // namespace content | 221 } // namespace content |
OLD | NEW |