| 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/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 is_auto_size_state_dirty_(false), | 83 is_auto_size_state_dirty_(false), |
| 84 persist_storage_(false), | 84 persist_storage_(false), |
| 85 valid_partition_id_(true), | 85 valid_partition_id_(true), |
| 86 content_window_routing_id_(MSG_ROUTING_NONE), | 86 content_window_routing_id_(MSG_ROUTING_NONE), |
| 87 plugin_focused_(false), | 87 plugin_focused_(false), |
| 88 visible_(true), | 88 visible_(true), |
| 89 before_first_navigation_(true), | 89 before_first_navigation_(true), |
| 90 mouse_locked_(false), | 90 mouse_locked_(false), |
| 91 browser_plugin_manager_(render_view->GetBrowserPluginManager()), | 91 browser_plugin_manager_(render_view->GetBrowserPluginManager()), |
| 92 compositing_enabled_(false), | 92 compositing_enabled_(false), |
| 93 embedder_frame_url_(frame->document().url()), |
| 93 weak_ptr_factory_(this) { | 94 weak_ptr_factory_(this) { |
| 94 } | 95 } |
| 95 | 96 |
| 96 BrowserPlugin::~BrowserPlugin() { | 97 BrowserPlugin::~BrowserPlugin() { |
| 97 // If the BrowserPlugin has never navigated then the browser process and | 98 // If the BrowserPlugin has never navigated then the browser process and |
| 98 // BrowserPluginManager don't know about it and so there is nothing to do | 99 // BrowserPluginManager don't know about it and so there is nothing to do |
| 99 // here. | 100 // here. |
| 100 if (!HasGuestInstanceID()) | 101 if (!HasGuestInstanceID()) |
| 101 return; | 102 return; |
| 102 browser_plugin_manager()->RemoveBrowserPlugin(guest_instance_id_); | 103 browser_plugin_manager()->RemoveBrowserPlugin(guest_instance_id_); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 368 } |
| 368 | 369 |
| 369 void BrowserPlugin::Attach(scoped_ptr<base::DictionaryValue> extra_params) { | 370 void BrowserPlugin::Attach(scoped_ptr<base::DictionaryValue> extra_params) { |
| 370 BrowserPluginHostMsg_Attach_Params attach_params; | 371 BrowserPluginHostMsg_Attach_Params attach_params; |
| 371 attach_params.focused = ShouldGuestBeFocused(); | 372 attach_params.focused = ShouldGuestBeFocused(); |
| 372 attach_params.visible = visible_; | 373 attach_params.visible = visible_; |
| 373 attach_params.name = GetNameAttribute(); | 374 attach_params.name = GetNameAttribute(); |
| 374 attach_params.storage_partition_id = storage_partition_id_; | 375 attach_params.storage_partition_id = storage_partition_id_; |
| 375 attach_params.persist_storage = persist_storage_; | 376 attach_params.persist_storage = persist_storage_; |
| 376 attach_params.src = GetSrcAttribute(); | 377 attach_params.src = GetSrcAttribute(); |
| 378 attach_params.embedder_frame_url = embedder_frame_url_; |
| 377 GetDamageBufferWithSizeParams(&attach_params.auto_size_params, | 379 GetDamageBufferWithSizeParams(&attach_params.auto_size_params, |
| 378 &attach_params.resize_guest_params, | 380 &attach_params.resize_guest_params, |
| 379 false); | 381 false); |
| 380 | 382 |
| 381 browser_plugin_manager()->Send( | 383 browser_plugin_manager()->Send( |
| 382 new BrowserPluginHostMsg_Attach(render_view_routing_id_, | 384 new BrowserPluginHostMsg_Attach(render_view_routing_id_, |
| 383 guest_instance_id_, attach_params, | 385 guest_instance_id_, attach_params, |
| 384 *extra_params)); | 386 *extra_params)); |
| 385 } | 387 } |
| 386 | 388 |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 const WebKit::WebMouseEvent& event) { | 1305 const WebKit::WebMouseEvent& event) { |
| 1304 browser_plugin_manager()->Send( | 1306 browser_plugin_manager()->Send( |
| 1305 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 1307 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
| 1306 guest_instance_id_, | 1308 guest_instance_id_, |
| 1307 plugin_rect_, | 1309 plugin_rect_, |
| 1308 &event)); | 1310 &event)); |
| 1309 return true; | 1311 return true; |
| 1310 } | 1312 } |
| 1311 | 1313 |
| 1312 } // namespace content | 1314 } // namespace content |
| OLD | NEW |