Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 354483004: Implement <appview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Addressed comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 new BrowserPluginHostMsg_SetAutoSize(render_view_routing_id_, 262 new BrowserPluginHostMsg_SetAutoSize(render_view_routing_id_,
263 guest_instance_id_, 263 guest_instance_id_,
264 auto_size_params, 264 auto_size_params,
265 resize_guest_params)); 265 resize_guest_params));
266 } 266 }
267 267
268 void BrowserPlugin::Attach(int guest_instance_id, 268 void BrowserPlugin::Attach(int guest_instance_id,
269 scoped_ptr<base::DictionaryValue> extra_params) { 269 scoped_ptr<base::DictionaryValue> extra_params) {
270 CHECK(guest_instance_id != browser_plugin::kInstanceIDNone); 270 CHECK(guest_instance_id != browser_plugin::kInstanceIDNone);
271 271
272 // If this BrowserPlugin is already attached to a guest, then do nothing. 272 // If this BrowserPlugin is already attached to a guest, then kill the guest.
273 if (HasGuestInstanceID()) 273 if (HasGuestInstanceID()) {
274 return; 274 guest_crashed_ = false;
275 EnableCompositing(false);
276 if (compositing_helper_) {
277 compositing_helper_->OnContainerDestroy();
278 compositing_helper_ = NULL;
279 }
280 browser_plugin_manager()->RemoveBrowserPlugin(guest_instance_id_);
281 browser_plugin_manager()->Send(new BrowserPluginHostMsg_PluginDestroyed(
282 render_view_routing_id_, guest_instance_id_));
lazyboy 2014/07/08 18:24:34 DCHECK_NE(guest_instance_id_, guest_instance_id)?
Fady Samuel 2014/07/08 20:23:46 I just added an early exit in this case. There's n
283 }
275 284
276 // This API may be called directly without setting the src attribute. 285 // This API may be called directly without setting the src attribute.
277 // In that case, we need to make sure we don't allocate another instance ID. 286 // In that case, we need to make sure we don't allocate another instance ID.
278 guest_instance_id_ = guest_instance_id; 287 guest_instance_id_ = guest_instance_id;
279 browser_plugin_manager()->AddBrowserPlugin(guest_instance_id, this); 288 browser_plugin_manager()->AddBrowserPlugin(guest_instance_id, this);
280 289
281 BrowserPluginHostMsg_Attach_Params attach_params; 290 BrowserPluginHostMsg_Attach_Params attach_params;
282 attach_params.focused = ShouldGuestBeFocused(); 291 attach_params.focused = ShouldGuestBeFocused();
283 attach_params.visible = visible_; 292 attach_params.visible = visible_;
284 attach_params.opaque = !GetAllowTransparencyAttribute(); 293 attach_params.opaque = !GetAllowTransparencyAttribute();
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 const blink::WebMouseEvent& event) { 962 const blink::WebMouseEvent& event) {
954 browser_plugin_manager()->Send( 963 browser_plugin_manager()->Send(
955 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, 964 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_,
956 guest_instance_id_, 965 guest_instance_id_,
957 plugin_rect_, 966 plugin_rect_,
958 &event)); 967 &event));
959 return true; 968 return true;
960 } 969 }
961 970
962 } // namespace content 971 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698