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