summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-15 01:15:44 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-15 01:15:44 +0000
commit9d4e3bf5a59ef130757b02a320708396b8fc74ee (patch)
tree8db2eafecb77592221acf5a80d5aee5abfc200af /chrome/renderer
parentb9a598494478fe8c04b6b7ba1f982ab91be6a521 (diff)
downloadchromium_src-9d4e3bf5a59ef130757b02a320708396b8fc74ee.zip
chromium_src-9d4e3bf5a59ef130757b02a320708396b8fc74ee.tar.gz
chromium_src-9d4e3bf5a59ef130757b02a320708396b8fc74ee.tar.bz2
Add an "x" to remove the blocked plug-in placeholder. The feature already
exists in the context menu, but now it works well enough to promote to the main placeholder UI. BUG=63695 TEST=see bug Review URL: http://codereview.chromium.org/5275007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/blocked_plugin.cc5
-rw-r--r--chrome/renderer/blocked_plugin.h6
-rw-r--r--chrome/renderer/resources/blocked_plugin.html11
3 files changed, 20 insertions, 2 deletions
diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc
index b0afe23..3bd7909 100644
--- a/chrome/renderer/blocked_plugin.cc
+++ b/chrome/renderer/blocked_plugin.cc
@@ -83,6 +83,7 @@ BlockedPlugin::~BlockedPlugin() {
void BlockedPlugin::BindWebFrame(WebFrame* frame) {
BindToJavascript(frame, "plugin");
BindMethod("load", &BlockedPlugin::Load);
+ BindMethod("hide", &BlockedPlugin::Hide);
}
void BlockedPlugin::WillDestroyPlugin() {
@@ -150,6 +151,10 @@ void BlockedPlugin::Load(const CppArgumentList& args, CppVariant* result) {
LoadPlugin();
}
+void BlockedPlugin::Hide(const CppArgumentList& args, CppVariant* result) {
+ HidePlugin();
+}
+
void BlockedPlugin::HidePlugin() {
CHECK(plugin_);
WebPluginContainer* container = plugin_->container();
diff --git a/chrome/renderer/blocked_plugin.h b/chrome/renderer/blocked_plugin.h
index fe68275..996831a 100644
--- a/chrome/renderer/blocked_plugin.h
+++ b/chrome/renderer/blocked_plugin.h
@@ -50,10 +50,14 @@ class BlockedPlugin : public CppBoundClass,
virtual ~BlockedPlugin();
// Javascript callbacks:
- // Load the blocked plugin by calling LoadPlugin() below.
+ // Load the blocked plugin by calling LoadPlugin().
// Takes no arguments, and returns nothing.
void Load(const CppArgumentList& args, CppVariant* result);
+ // Hide the blocked plugin by calling HidePlugin().
+ // Takes no arguments, and returns nothing.
+ void Hide(const CppArgumentList& args, CppVariant* result);
+
// Hide the blocked plugin.
void HidePlugin();
diff --git a/chrome/renderer/resources/blocked_plugin.html b/chrome/renderer/resources/blocked_plugin.html
index 0553163..1686d7a 100644
--- a/chrome/renderer/resources/blocked_plugin.html
+++ b/chrome/renderer/resources/blocked_plugin.html
@@ -22,7 +22,7 @@ h1 {
visibility: hidden;
}
-#outer:hover h1 {
+#outer:hover h1, #outer:hover img {
visibility: visible;
}
@@ -48,6 +48,14 @@ p {
top: 50%;
margin-top: -70px;
}
+
+#close {
+ visibility: hidden;
+ cursor: pointer;
+ position: absolute;
+ right: 0px;
+ top: 0px;
+}
</style>
</head>
@@ -58,6 +66,7 @@ p {
<h1 i18n-content="message">PLUGIN_BLOCKED</h1>
<p id="debug"> </p>
</div>
+<img id="close" onclick="plugin.hide();" src="../../app/theme/close_bar_h.png">
</div>
</body>
</html>