summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_installer_infobar_delegate.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-08 04:20:40 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-08 04:20:40 +0000
commitec8f51164d477d8d83726fe61c68977d17b03149 (patch)
treede1ea01984caab5a5841c8a7c1593805157ce60d /chrome/browser/plugin_installer_infobar_delegate.cc
parentef47ded033e48098e83bb94e63b6e44ca6b511b4 (diff)
downloadchromium_src-ec8f51164d477d8d83726fe61c68977d17b03149.zip
chromium_src-ec8f51164d477d8d83726fe61c68977d17b03149.tar.gz
chromium_src-ec8f51164d477d8d83726fe61c68977d17b03149.tar.bz2
Cleanup:
* Change int to size_t in a few APIs. * Rename infobar_delegate_count() to infobar_count() in preparation for TabContents owning InfoBars rather than InfoBarDelegates. * Move some code from PluginInstallerInfoBarDelegate to PluginObserver since it's more related to who's instantiating the infobar(delegate)s. * Unify InfoBarDelegate behavior by making no delegates auto-add themselves to tabs (callers now all do this explicitly). * Eliminate unused member TabContentsSSLHelper::SSLAddCertData::handler_. * De-inline a couple classes. * Make more functions private. * Add some consts. * Change DCHECK() to DCHECK_EQ() where possible. * Rename the delegates in plugin_observer.cc to have "Delegate" in the names. * Remove unnecessary qualifiers. * Simplify. * Misc. style issues, naming issues, etc. BUG=none TEST=none Review URL: http://codereview.chromium.org/6250172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_installer_infobar_delegate.cc')
-rw-r--r--chrome/browser/plugin_installer_infobar_delegate.cc27
1 files changed, 5 insertions, 22 deletions
diff --git a/chrome/browser/plugin_installer_infobar_delegate.cc b/chrome/browser/plugin_installer_infobar_delegate.cc
index 8a035ed..3898e0c 100644
--- a/chrome/browser/plugin_installer_infobar_delegate.cc
+++ b/chrome/browser/plugin_installer_infobar_delegate.cc
@@ -11,7 +11,6 @@
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "webkit/plugins/npapi/default_plugin_shared.h"
PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate(
TabContents* tab_contents)
@@ -20,27 +19,6 @@ PluginInstallerInfoBarDelegate::PluginInstallerInfoBarDelegate(
}
PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() {
- // Remove any InfoBars we may be showing.
- tab_contents_->RemoveInfoBar(this);
-}
-
-void PluginInstallerInfoBarDelegate::OnMissingPluginStatus(int status) {
- switch (status) {
- case webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE: {
- tab_contents_->AddInfoBar(this);
- break;
- }
- case webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD: {
- // Hide the InfoBar if user already started download/install of the
- // missing plugin.
- tab_contents_->RemoveInfoBar(this);
- break;
- }
- default: {
- NOTREACHED();
- break;
- }
- }
}
SkBitmap* PluginInstallerInfoBarDelegate::GetIcon() const {
@@ -48,6 +26,11 @@ SkBitmap* PluginInstallerInfoBarDelegate::GetIcon() const {
IDR_INFOBAR_PLUGIN_INSTALL);
}
+PluginInstallerInfoBarDelegate*
+ PluginInstallerInfoBarDelegate::AsPluginInstallerInfoBarDelegate() {
+ return this;
+}
+
string16 PluginInstallerInfoBarDelegate::GetMessageText() const {
return l10n_util::GetStringUTF16(IDS_PLUGININSTALLER_MISSINGPLUGIN_PROMPT);
}