| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/plugins/plugin_infobar_delegates.h" | 5 #include "chrome/browser/plugins/plugin_infobar_delegates.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( | 145 ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins( |
| 146 web_contents, true, identifier_); | 146 web_contents, true, identifier_); |
| 147 | 147 |
| 148 return true; | 148 return true; |
| 149 } | 149 } |
| 150 | 150 |
| 151 base::string16 OutdatedPluginInfoBarDelegate::GetLinkText() const { | 151 base::string16 OutdatedPluginInfoBarDelegate::GetLinkText() const { |
| 152 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 152 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool OutdatedPluginInfoBarDelegate::LinkClicked( | 155 GURL OutdatedPluginInfoBarDelegate::GetLinkURL() const { |
| 156 WindowOpenDisposition disposition) { | 156 return GURL(chrome::kOutdatedPluginLearnMoreURL); |
| 157 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.LearnMore")); | |
| 158 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( | |
| 159 content::OpenURLParams( | |
| 160 GURL(chrome::kOutdatedPluginLearnMoreURL), content::Referrer(), | |
| 161 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | |
| 162 ui::PAGE_TRANSITION_LINK, false)); | |
| 163 return false; | |
| 164 } | 157 } |
| 165 | 158 |
| 166 void OutdatedPluginInfoBarDelegate::DownloadStarted() { | 159 void OutdatedPluginInfoBarDelegate::DownloadStarted() { |
| 167 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOADING, | 160 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOADING, |
| 168 plugin_metadata_->name())); | 161 plugin_metadata_->name())); |
| 169 } | 162 } |
| 170 | 163 |
| 171 void OutdatedPluginInfoBarDelegate::DownloadError(const std::string& message) { | 164 void OutdatedPluginInfoBarDelegate::DownloadError(const std::string& message) { |
| 172 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_ERROR_SHORT, | 165 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_ERROR_SHORT, |
| 173 plugin_metadata_->name())); | 166 plugin_metadata_->name())); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 263 |
| 271 bool PluginMetroModeInfoBarDelegate::Accept() { | 264 bool PluginMetroModeInfoBarDelegate::Accept() { |
| 272 chrome::AttemptRestartToDesktopMode(); | 265 chrome::AttemptRestartToDesktopMode(); |
| 273 return true; | 266 return true; |
| 274 } | 267 } |
| 275 | 268 |
| 276 base::string16 PluginMetroModeInfoBarDelegate::GetLinkText() const { | 269 base::string16 PluginMetroModeInfoBarDelegate::GetLinkText() const { |
| 277 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 270 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
| 278 } | 271 } |
| 279 | 272 |
| 280 bool PluginMetroModeInfoBarDelegate::LinkClicked( | 273 GURL PluginMetroModeInfoBarDelegate::GetLinkURL() const { |
| 281 WindowOpenDisposition disposition) { | 274 return GURL( |
| 282 // TODO(shrikant): We may need to change language a little at following | 275 (mode_ == MISSING_PLUGIN) |
| 283 // support URLs. With new approach we will just restart for both missing | 276 ? "https://support.google.com/chrome/?p=ib_display_in_desktop" |
| 284 // and not missing mode. | 277 : "https://support.google.com/chrome/?p=ib_redirect_to_desktop"); |
| 285 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL( | |
| 286 content::OpenURLParams( | |
| 287 GURL((mode_ == MISSING_PLUGIN) ? | |
| 288 "https://support.google.com/chrome/?p=ib_display_in_desktop" : | |
| 289 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), | |
| 290 content::Referrer(), | |
| 291 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | |
| 292 ui::PAGE_TRANSITION_LINK, false)); | |
| 293 return false; | |
| 294 } | 278 } |
| 295 | 279 |
| 296 #endif // defined(OS_WIN) | 280 #endif // defined(OS_WIN) |
| 297 | 281 |
| 298 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 282 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| OLD | NEW |