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

Unified Diff: chrome/renderer/blocked_plugin.cc

Issue 6354025: Add hide icon on the click-to-play UI too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/blocked_plugin.cc
===================================================================
--- chrome/renderer/blocked_plugin.cc (revision 72559)
+++ chrome/renderer/blocked_plugin.cc (working copy)
@@ -60,7 +60,8 @@
: RenderViewObserver(render_view),
frame_(frame),
plugin_params_(params),
- is_blocked_for_prerendering_(is_blocked_for_prerendering) {
+ is_blocked_for_prerendering_(is_blocked_for_prerendering),
+ hidden_(false) {
const base::StringPiece template_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(template_id));
@@ -156,6 +157,10 @@
void BlockedPlugin::LoadPlugin() {
CHECK(plugin_);
+ // This is not strictly necessary but is an important defense in case the
+ // event propagation changes between "close" vs. "click-to-play".
+ if (hidden_)
+ return;
WebPluginContainer* container = plugin_->container();
WebPlugin* new_plugin =
render_view()->CreatePluginNoCheck(frame_, plugin_params_);
@@ -178,6 +183,7 @@
void BlockedPlugin::HidePlugin() {
CHECK(plugin_);
+ hidden_ = true;
WebPluginContainer* container = plugin_->container();
WebElement element = container->element();
element.setAttribute("style", "display: none;");

Powered by Google App Engine
This is Rietveld 408576698