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/plugin/webplugin_proxy.h" | 5 #include "content/plugin/webplugin_proxy.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 if (window_npobject_) | 213 if (window_npobject_) |
214 return window_npobject_; | 214 return window_npobject_; |
215 | 215 |
216 int npobject_route_id = channel_->GenerateRouteID(); | 216 int npobject_route_id = channel_->GenerateRouteID(); |
217 bool success = false; | 217 bool success = false; |
218 Send(new PluginHostMsg_GetWindowScriptNPObject( | 218 Send(new PluginHostMsg_GetWindowScriptNPObject( |
219 route_id_, npobject_route_id, &success)); | 219 route_id_, npobject_route_id, &success)); |
220 if (!success) | 220 if (!success) |
221 return NULL; | 221 return NULL; |
222 | 222 |
| 223 // PluginChannel creates a dummy owner identifier for unknown owners, so |
| 224 // use that. |
| 225 NPP owner = channel_->GetExistingNPObjectOwner(MSG_ROUTING_NONE); |
| 226 |
223 window_npobject_ = NPObjectProxy::Create(channel_.get(), | 227 window_npobject_ = NPObjectProxy::Create(channel_.get(), |
224 npobject_route_id, | 228 npobject_route_id, |
225 host_render_view_routing_id_, | 229 host_render_view_routing_id_, |
226 page_url_); | 230 page_url_, |
| 231 owner); |
227 | 232 |
228 return window_npobject_; | 233 return window_npobject_; |
229 } | 234 } |
230 | 235 |
231 NPObject* WebPluginProxy::GetPluginElement() { | 236 NPObject* WebPluginProxy::GetPluginElement() { |
232 if (plugin_element_) | 237 if (plugin_element_) |
233 return plugin_element_; | 238 return plugin_element_; |
234 | 239 |
235 int npobject_route_id = channel_->GenerateRouteID(); | 240 int npobject_route_id = channel_->GenerateRouteID(); |
236 bool success = false; | 241 bool success = false; |
237 Send(new PluginHostMsg_GetPluginElement(route_id_, npobject_route_id, | 242 Send(new PluginHostMsg_GetPluginElement(route_id_, npobject_route_id, |
238 &success)); | 243 &success)); |
239 if (!success) | 244 if (!success) |
240 return NULL; | 245 return NULL; |
241 | 246 |
| 247 // PluginChannel creates a dummy owner identifier for unknown owners, so |
| 248 // use that. |
| 249 NPP owner = channel_->GetExistingNPObjectOwner(MSG_ROUTING_NONE); |
| 250 |
242 plugin_element_ = NPObjectProxy::Create(channel_.get(), | 251 plugin_element_ = NPObjectProxy::Create(channel_.get(), |
243 npobject_route_id, | 252 npobject_route_id, |
244 host_render_view_routing_id_, | 253 host_render_view_routing_id_, |
245 page_url_); | 254 page_url_, |
| 255 owner); |
246 | 256 |
247 return plugin_element_; | 257 return plugin_element_; |
248 } | 258 } |
249 | 259 |
250 bool WebPluginProxy::FindProxyForUrl(const GURL& url, std::string* proxy_list) { | 260 bool WebPluginProxy::FindProxyForUrl(const GURL& url, std::string* proxy_list) { |
251 bool result = false; | 261 bool result = false; |
252 Send(new PluginHostMsg_ResolveProxy(route_id_, url, &result, proxy_list)); | 262 Send(new PluginHostMsg_ResolveProxy(route_id_, url, &result, proxy_list)); |
253 return result; | 263 return result; |
254 } | 264 } |
255 | 265 |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 int input_type; | 705 int input_type; |
696 gfx::Rect caret_rect; | 706 gfx::Rect caret_rect; |
697 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 707 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
698 return; | 708 return; |
699 | 709 |
700 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 710 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
701 } | 711 } |
702 #endif | 712 #endif |
703 | 713 |
704 } // namespace content | 714 } // namespace content |
OLD | NEW |