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

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

Issue 23591016: BrowserPlugin/WebView - Move plugin lifetime to DOM (Chromium-side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update BrowserPlugin tests to reflect new behaviour. Created 6 years, 8 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 | Annotate | Revision Log
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/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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 bool embedder_focused = false; 878 bool embedder_focused = false;
879 if (render_view_.get()) 879 if (render_view_.get())
880 embedder_focused = render_view_->has_focus(); 880 embedder_focused = render_view_->has_focus();
881 return plugin_focused_ && embedder_focused; 881 return plugin_focused_ && embedder_focused;
882 } 882 }
883 883
884 blink::WebPluginContainer* BrowserPlugin::container() const { 884 blink::WebPluginContainer* BrowserPlugin::container() const {
885 return container_; 885 return container_;
886 } 886 }
887 887
888 void BrowserPlugin::containerDidDetachFromParent() {
889 EnableCompositing(false);
890 }
891
888 bool BrowserPlugin::initialize(WebPluginContainer* container) { 892 bool BrowserPlugin::initialize(WebPluginContainer* container) {
889 if (!container) 893 if (!container)
890 return false; 894 return false;
891 895
892 if (!GetContentClient()->renderer()->AllowBrowserPlugin(container)) 896 if (!GetContentClient()->renderer()->AllowBrowserPlugin(container))
893 return false; 897 return false;
894 898
895 // Tell |container| to allow this plugin to use script objects. 899 // Tell |container| to allow this plugin to use script objects.
896 npp_.reset(new NPP_t); 900 npp_.reset(new NPP_t);
897 container->allowScriptObjects(); 901 container->allowScriptObjects();
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 bool BrowserPlugin::HandleMouseLockedInputEvent( 1381 bool BrowserPlugin::HandleMouseLockedInputEvent(
1378 const blink::WebMouseEvent& event) { 1382 const blink::WebMouseEvent& event) {
1379 browser_plugin_manager()->Send( 1383 browser_plugin_manager()->Send(
1380 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, 1384 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_,
1381 guest_instance_id_, 1385 guest_instance_id_,
1382 plugin_rect_, 1386 plugin_rect_,
1383 &event)); 1387 &event));
1384 return true; 1388 return true;
1385 } 1389 }
1386 1390
1391 bool BrowserPlugin::shouldPersist() const { return true; }
1392
1387 } // namespace content 1393 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698