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 window_npobject_ = NPObjectProxy::Create( | 223 window_npobject_ = NPObjectProxy::Create(channel_.get(), |
224 channel_, npobject_route_id, host_render_view_routing_id_, page_url_); | 224 npobject_route_id, |
| 225 host_render_view_routing_id_, |
| 226 page_url_); |
225 | 227 |
226 return window_npobject_; | 228 return window_npobject_; |
227 } | 229 } |
228 | 230 |
229 NPObject* WebPluginProxy::GetPluginElement() { | 231 NPObject* WebPluginProxy::GetPluginElement() { |
230 if (plugin_element_) | 232 if (plugin_element_) |
231 return plugin_element_; | 233 return plugin_element_; |
232 | 234 |
233 int npobject_route_id = channel_->GenerateRouteID(); | 235 int npobject_route_id = channel_->GenerateRouteID(); |
234 bool success = false; | 236 bool success = false; |
235 Send(new PluginHostMsg_GetPluginElement(route_id_, npobject_route_id, | 237 Send(new PluginHostMsg_GetPluginElement(route_id_, npobject_route_id, |
236 &success)); | 238 &success)); |
237 if (!success) | 239 if (!success) |
238 return NULL; | 240 return NULL; |
239 | 241 |
240 plugin_element_ = NPObjectProxy::Create( | 242 plugin_element_ = NPObjectProxy::Create(channel_.get(), |
241 channel_, npobject_route_id, host_render_view_routing_id_, page_url_); | 243 npobject_route_id, |
| 244 host_render_view_routing_id_, |
| 245 page_url_); |
242 | 246 |
243 return plugin_element_; | 247 return plugin_element_; |
244 } | 248 } |
245 | 249 |
246 bool WebPluginProxy::FindProxyForUrl(const GURL& url, std::string* proxy_list) { | 250 bool WebPluginProxy::FindProxyForUrl(const GURL& url, std::string* proxy_list) { |
247 bool result = false; | 251 bool result = false; |
248 Send(new PluginHostMsg_ResolveProxy(route_id_, url, &result, proxy_list)); | 252 Send(new PluginHostMsg_ResolveProxy(route_id_, url, &result, proxy_list)); |
249 return result; | 253 return result; |
250 } | 254 } |
251 | 255 |
(...skipping 19 matching lines...) Expand all Loading... |
271 // now possible to receive stream messages from the renderer for streams | 275 // now possible to receive stream messages from the renderer for streams |
272 // which may have been cancelled by the plugin. | 276 // which may have been cancelled by the plugin. |
273 if (iterator == resource_clients_.end()) { | 277 if (iterator == resource_clients_.end()) { |
274 return NULL; | 278 return NULL; |
275 } | 279 } |
276 | 280 |
277 return iterator->second; | 281 return iterator->second; |
278 } | 282 } |
279 | 283 |
280 int WebPluginProxy::GetRendererId() { | 284 int WebPluginProxy::GetRendererId() { |
281 if (channel_) | 285 if (channel_.get()) |
282 return channel_->renderer_id(); | 286 return channel_->renderer_id(); |
283 return -1; | 287 return -1; |
284 } | 288 } |
285 | 289 |
286 void WebPluginProxy::DidPaint() { | 290 void WebPluginProxy::DidPaint() { |
287 // If we have an accumulated damaged rect, then check to see if we need to | 291 // If we have an accumulated damaged rect, then check to see if we need to |
288 // send out another InvalidateRect message. | 292 // send out another InvalidateRect message. |
289 waiting_for_paint_ = false; | 293 waiting_for_paint_ = false; |
290 if (!damaged_rect_.IsEmpty()) | 294 if (!damaged_rect_.IsEmpty()) |
291 InvalidateRect(damaged_rect_); | 295 InvalidateRect(damaged_rect_); |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 int input_type; | 695 int input_type; |
692 gfx::Rect caret_rect; | 696 gfx::Rect caret_rect; |
693 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 697 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
694 return; | 698 return; |
695 | 699 |
696 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 700 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
697 } | 701 } |
698 #endif | 702 #endif |
699 | 703 |
700 } // namespace content | 704 } // namespace content |
OLD | NEW |