diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-10 13:20:36 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-10 13:20:36 +0000 |
commit | 1a86f75dffd931514c1db92725c47e727682de5a (patch) | |
tree | 5e200670869a2825567c645fa865422c2193287c /chrome/browser/plugin_infobar_delegates.cc | |
parent | ac2d85013a3f8908cefc12fca0dcb40a526e6c39 (diff) | |
download | chromium_src-1a86f75dffd931514c1db92725c47e727682de5a.zip chromium_src-1a86f75dffd931514c1db92725c47e727682de5a.tar.gz chromium_src-1a86f75dffd931514c1db92725c47e727682de5a.tar.bz2 |
Use regular download mechanism to download and open plug-in installer files.
As downloads can now be cancelled as well, add a DownloadCancelled callback to PluginInstallerObserver, and rename the others to be consistent in naming.
BUG=110484
TEST=none
Review URL: http://codereview.chromium.org/9370018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121439 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_infobar_delegates.cc')
-rw-r--r-- | chrome/browser/plugin_infobar_delegates.cc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/chrome/browser/plugin_infobar_delegates.cc b/chrome/browser/plugin_infobar_delegates.cc index f911ffe..5940568 100644 --- a/chrome/browser/plugin_infobar_delegates.cc +++ b/chrome/browser/plugin_infobar_delegates.cc @@ -219,7 +219,7 @@ bool OutdatedPluginInfoBarDelegate::Accept() { if (installer()->url_for_display()) { installer()->OpenDownloadURL(web_contents); } else { - installer()->StartInstalling(web_contents); + installer()->StartInstalling(observer_->tab_contents_wrapper()); } return false; } @@ -243,19 +243,23 @@ bool OutdatedPluginInfoBarDelegate::LinkClicked( return PluginInfoBarDelegate::LinkClicked(disposition); } -void OutdatedPluginInfoBarDelegate::DidStartDownload() { +void OutdatedPluginInfoBarDelegate::DownloadStarted() { ReplaceWithInfoBar(l10n_util::GetStringUTF16(IDS_PLUGIN_DOWNLOADING)); } -void OutdatedPluginInfoBarDelegate::DidFinishDownload() { - ReplaceWithInfoBar(l10n_util::GetStringUTF16(IDS_PLUGIN_UPDATING)); -} - void OutdatedPluginInfoBarDelegate::DownloadError(const std::string& message) { ReplaceWithInfoBar( l10n_util::GetStringUTF16(IDS_PLUGIN_DOWNLOAD_ERROR_SHORT)); } +void OutdatedPluginInfoBarDelegate::DownloadCancelled() { + ReplaceWithInfoBar(l10n_util::GetStringUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED)); +} + +void OutdatedPluginInfoBarDelegate::DownloadFinished() { + ReplaceWithInfoBar(l10n_util::GetStringUTF16(IDS_PLUGIN_UPDATING)); +} + void OutdatedPluginInfoBarDelegate::OnlyWeakObserversLeft() { if (owner()) owner()->RemoveInfoBar(this); @@ -357,13 +361,12 @@ bool PluginInstallerInfoBarDelegate::LinkClicked( return false; } -void PluginInstallerInfoBarDelegate::DidStartDownload() { +void PluginInstallerInfoBarDelegate::DownloadStarted() { ReplaceWithInfoBar(l10n_util::GetStringUTF16(IDS_PLUGIN_DOWNLOADING)); } -void PluginInstallerInfoBarDelegate::DidFinishDownload() { - ReplaceWithInfoBar(l10n_util::GetStringUTF16( - new_install_ ? IDS_PLUGIN_INSTALLING : IDS_PLUGIN_UPDATING)); +void PluginInstallerInfoBarDelegate::DownloadCancelled() { + ReplaceWithInfoBar(l10n_util::GetStringUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED)); } void PluginInstallerInfoBarDelegate::DownloadError(const std::string& message) { @@ -371,6 +374,11 @@ void PluginInstallerInfoBarDelegate::DownloadError(const std::string& message) { l10n_util::GetStringUTF16(IDS_PLUGIN_DOWNLOAD_ERROR_SHORT)); } +void PluginInstallerInfoBarDelegate::DownloadFinished() { + ReplaceWithInfoBar(l10n_util::GetStringUTF16( + new_install_ ? IDS_PLUGIN_INSTALLING : IDS_PLUGIN_UPDATING)); +} + void PluginInstallerInfoBarDelegate::OnlyWeakObserversLeft() { if (owner()) owner()->RemoveInfoBar(this); |