OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/renderer/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 last_device_scale_factor_(GetDeviceScaleFactor()), | 54 last_device_scale_factor_(GetDeviceScaleFactor()), |
55 sad_guest_(NULL), | 55 sad_guest_(NULL), |
56 guest_crashed_(false), | 56 guest_crashed_(false), |
57 is_auto_size_state_dirty_(false), | 57 is_auto_size_state_dirty_(false), |
58 content_window_routing_id_(MSG_ROUTING_NONE), | 58 content_window_routing_id_(MSG_ROUTING_NONE), |
59 plugin_focused_(false), | 59 plugin_focused_(false), |
60 visible_(true), | 60 visible_(true), |
61 auto_navigate_(auto_navigate), | 61 auto_navigate_(auto_navigate), |
62 mouse_locked_(false), | 62 mouse_locked_(false), |
63 browser_plugin_manager_(render_view->GetBrowserPluginManager()), | 63 browser_plugin_manager_(render_view->GetBrowserPluginManager()), |
64 embedder_frame_url_(frame->document().url()), | |
65 weak_ptr_factory_(this) { | 64 weak_ptr_factory_(this) { |
66 } | 65 } |
67 | 66 |
68 BrowserPlugin::~BrowserPlugin() { | 67 BrowserPlugin::~BrowserPlugin() { |
69 // If the BrowserPlugin has never navigated then the browser process and | 68 // If the BrowserPlugin has never navigated then the browser process and |
70 // BrowserPluginManager don't know about it and so there is nothing to do | 69 // BrowserPluginManager don't know about it and so there is nothing to do |
71 // here. | 70 // here. |
72 if (!HasGuestInstanceID()) | 71 if (!HasGuestInstanceID()) |
73 return; | 72 return; |
74 browser_plugin_manager()->RemoveBrowserPlugin(guest_instance_id_); | 73 browser_plugin_manager()->RemoveBrowserPlugin(guest_instance_id_); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 285 |
287 // This API may be called directly without setting the src attribute. | 286 // This API may be called directly without setting the src attribute. |
288 // In that case, we need to make sure we don't allocate another instance ID. | 287 // In that case, we need to make sure we don't allocate another instance ID. |
289 guest_instance_id_ = guest_instance_id; | 288 guest_instance_id_ = guest_instance_id; |
290 browser_plugin_manager()->AddBrowserPlugin(guest_instance_id, this); | 289 browser_plugin_manager()->AddBrowserPlugin(guest_instance_id, this); |
291 | 290 |
292 BrowserPluginHostMsg_Attach_Params attach_params; | 291 BrowserPluginHostMsg_Attach_Params attach_params; |
293 attach_params.focused = ShouldGuestBeFocused(); | 292 attach_params.focused = ShouldGuestBeFocused(); |
294 attach_params.visible = visible_; | 293 attach_params.visible = visible_; |
295 attach_params.opaque = !GetAllowTransparencyAttribute(); | 294 attach_params.opaque = !GetAllowTransparencyAttribute(); |
296 attach_params.embedder_frame_url = embedder_frame_url_; | |
297 attach_params.origin = plugin_rect().origin(); | 295 attach_params.origin = plugin_rect().origin(); |
298 GetSizeParams(&attach_params.auto_size_params, | 296 GetSizeParams(&attach_params.auto_size_params, |
299 &attach_params.resize_guest_params, | 297 &attach_params.resize_guest_params, |
300 false); | 298 false); |
301 | 299 |
302 browser_plugin_manager()->Send( | 300 browser_plugin_manager()->Send( |
303 new BrowserPluginHostMsg_Attach(render_view_routing_id_, | 301 new BrowserPluginHostMsg_Attach(render_view_routing_id_, |
304 guest_instance_id_, attach_params, | 302 guest_instance_id_, attach_params, |
305 *extra_params)); | 303 *extra_params)); |
306 } | 304 } |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 const blink::WebMouseEvent& event) { | 961 const blink::WebMouseEvent& event) { |
964 browser_plugin_manager()->Send( | 962 browser_plugin_manager()->Send( |
965 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 963 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
966 guest_instance_id_, | 964 guest_instance_id_, |
967 plugin_rect_, | 965 plugin_rect_, |
968 &event)); | 966 &event)); |
969 return true; | 967 return true; |
970 } | 968 } |
971 | 969 |
972 } // namespace content | 970 } // namespace content |
OLD | NEW |