summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_installer_infobar_delegate.cc
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 11:57:51 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 11:57:51 +0000
commit1d697f38d70b8edaca243a49f790b525c1c95a9d (patch)
treed865f1e7f9984aea144a889c51ddd6fff443ad05 /chrome/browser/plugin_installer_infobar_delegate.cc
parent2f606239c901c6c464ae0323a9eb577401cdaacc (diff)
downloadchromium_src-1d697f38d70b8edaca243a49f790b525c1c95a9d.zip
chromium_src-1d697f38d70b8edaca243a49f790b525c1c95a9d.tar.gz
chromium_src-1d697f38d70b8edaca243a49f790b525c1c95a9d.tar.bz2
Show infobar for missing plug-ins on Mac.
TBR=arv@chromium.org BUG=62079 TEST=none Review URL: http://codereview.chromium.org/8578009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_installer_infobar_delegate.cc')
-rw-r--r--chrome/browser/plugin_installer_infobar_delegate.cc35
1 files changed, 21 insertions, 14 deletions
diff --git a/chrome/browser/plugin_installer_infobar_delegate.cc b/chrome/browser/plugin_installer_infobar_delegate.cc
index 02b8f2d..01f054b 100644
--- a/chrome/browser/plugin_installer_infobar_delegate.cc
+++ b/chrome/browser/plugin_installer_infobar_delegate.cc
@@ -13,12 +13,16 @@
#include "grit/theme_resources_standard.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(
- InfoBarTabHelper* infobar_helper, gfx::NativeWindow window)
+ InfoBarTabHelper* infobar_helper,
+ const string16& plugin_name,
+ const GURL& learn_more_url,
+ const base::Closure& callback)
: ConfirmInfoBarDelegate(infobar_helper),
- window_(window) {
+ plugin_name_(plugin_name),
+ learn_more_url_(learn_more_url),
+ callback_(callback) {
}
PluginInstallerInfoBarDelegate::~PluginInstallerInfoBarDelegate() {
@@ -35,7 +39,11 @@ PluginInstallerInfoBarDelegate*
}
string16 PluginInstallerInfoBarDelegate::GetMessageText() const {
- return l10n_util::GetStringUTF16(IDS_PLUGININSTALLER_MISSINGPLUGIN_PROMPT);
+ // TODO(bauerb): Remove this check when removing the default plug-in.
+ return plugin_name_.empty() ?
+ l10n_util::GetStringUTF16(IDS_PLUGININSTALLER_MISSINGPLUGIN_PROMPT) :
+ l10n_util::GetStringFUTF16(IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT,
+ plugin_name_);
}
int PluginInstallerInfoBarDelegate::GetButtons() const {
@@ -49,13 +57,7 @@ string16 PluginInstallerInfoBarDelegate::GetButtonLabel(
}
bool PluginInstallerInfoBarDelegate::Accept() {
- // TODO(PORT) for other platforms.
-#if defined(OS_WIN)
- ::PostMessage(window_,
- webkit::npapi::default_plugin::kInstallMissingPluginMessage,
- 0,
- 0);
-#endif
+ callback_.Run();
return true;
}
@@ -65,9 +67,14 @@ string16 PluginInstallerInfoBarDelegate::GetLinkText() const {
bool PluginInstallerInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- owner()->tab_contents()->OpenURL(google_util::AppendGoogleLocaleParam(GURL(
- "https://www.google.com/support/chrome/bin/answer.py?answer=142064")),
- GURL(),
+ GURL url(learn_more_url_);
+ // TODO(bauerb): Remove this check when removing the default plug-in.
+ if (url.is_empty()) {
+ url = google_util::AppendGoogleLocaleParam(GURL(
+ "https://www.google.com/support/chrome/bin/answer.py?answer=142064"));
+ }
+ owner()->tab_contents()->OpenURL(
+ url, GURL(),
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
content::PAGE_TRANSITION_LINK);
return false;