| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } else if (name == PluginMetadata::kAdobeReaderGroupName) { | 95 } else if (name == PluginMetadata::kAdobeReaderGroupName) { |
| 96 content::RecordAction( | 96 content::RecordAction( |
| 97 UserMetricsAction("OutdatedPluginInfobar.Shown.Reader")); | 97 UserMetricsAction("OutdatedPluginInfobar.Shown.Reader")); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 OutdatedPluginInfoBarDelegate::~OutdatedPluginInfoBarDelegate() { | 101 OutdatedPluginInfoBarDelegate::~OutdatedPluginInfoBarDelegate() { |
| 102 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed")); | 102 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed")); |
| 103 } | 103 } |
| 104 | 104 |
| 105 std::string OutdatedPluginInfoBarDelegate::GetIdentifier() const { |
| 106 return "OutdatedPluginInfoBarDelegate"; |
| 107 } |
| 108 |
| 105 void OutdatedPluginInfoBarDelegate::InfoBarDismissed() { | 109 void OutdatedPluginInfoBarDelegate::InfoBarDismissed() { |
| 106 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Dismissed")); | 110 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Dismissed")); |
| 107 } | 111 } |
| 108 | 112 |
| 109 int OutdatedPluginInfoBarDelegate::GetIconId() const { | 113 int OutdatedPluginInfoBarDelegate::GetIconId() const { |
| 110 return IDR_INFOBAR_PLUGIN_INSTALL; | 114 return IDR_INFOBAR_PLUGIN_INSTALL; |
| 111 } | 115 } |
| 112 | 116 |
| 113 base::string16 OutdatedPluginInfoBarDelegate::GetMessageText() const { | 117 base::string16 OutdatedPluginInfoBarDelegate::GetMessageText() const { |
| 114 return message_; | 118 return message_; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 PluginMetroModeInfoBarDelegate::Mode mode, | 230 PluginMetroModeInfoBarDelegate::Mode mode, |
| 227 const base::string16& name) | 231 const base::string16& name) |
| 228 : ConfirmInfoBarDelegate(), | 232 : ConfirmInfoBarDelegate(), |
| 229 mode_(mode), | 233 mode_(mode), |
| 230 name_(name) { | 234 name_(name) { |
| 231 } | 235 } |
| 232 | 236 |
| 233 PluginMetroModeInfoBarDelegate::~PluginMetroModeInfoBarDelegate() { | 237 PluginMetroModeInfoBarDelegate::~PluginMetroModeInfoBarDelegate() { |
| 234 } | 238 } |
| 235 | 239 |
| 240 std::string PluginMetroModeInfoBarDelegate::GetIdentifier() const { |
| 241 return "PluginMetroModeInfoBarDelegate"; |
| 242 } |
| 243 |
| 236 int PluginMetroModeInfoBarDelegate::GetIconId() const { | 244 int PluginMetroModeInfoBarDelegate::GetIconId() const { |
| 237 return IDR_INFOBAR_PLUGIN_INSTALL; | 245 return IDR_INFOBAR_PLUGIN_INSTALL; |
| 238 } | 246 } |
| 239 | 247 |
| 240 base::string16 PluginMetroModeInfoBarDelegate::GetMessageText() const { | 248 base::string16 PluginMetroModeInfoBarDelegate::GetMessageText() const { |
| 241 return l10n_util::GetStringFUTF16((mode_ == MISSING_PLUGIN) ? | 249 return l10n_util::GetStringFUTF16((mode_ == MISSING_PLUGIN) ? |
| 242 IDS_METRO_MISSING_PLUGIN_PROMPT : IDS_METRO_NPAPI_PLUGIN_PROMPT, name_); | 250 IDS_METRO_MISSING_PLUGIN_PROMPT : IDS_METRO_NPAPI_PLUGIN_PROMPT, name_); |
| 243 } | 251 } |
| 244 | 252 |
| 245 int PluginMetroModeInfoBarDelegate::GetButtons() const { | 253 int PluginMetroModeInfoBarDelegate::GetButtons() const { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 GURL PluginMetroModeInfoBarDelegate::GetLinkURL() const { | 285 GURL PluginMetroModeInfoBarDelegate::GetLinkURL() const { |
| 278 return GURL( | 286 return GURL( |
| 279 (mode_ == MISSING_PLUGIN) | 287 (mode_ == MISSING_PLUGIN) |
| 280 ? "https://support.google.com/chrome/?p=ib_display_in_desktop" | 288 ? "https://support.google.com/chrome/?p=ib_display_in_desktop" |
| 281 : "https://support.google.com/chrome/?p=ib_redirect_to_desktop"); | 289 : "https://support.google.com/chrome/?p=ib_redirect_to_desktop"); |
| 282 } | 290 } |
| 283 | 291 |
| 284 #endif // defined(OS_WIN) | 292 #endif // defined(OS_WIN) |
| 285 | 293 |
| 286 #endif // defined(ENABLE_PLUGIN_INSTALLATION) | 294 #endif // defined(ENABLE_PLUGIN_INSTALLATION) |
| OLD | NEW |