Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/plugins/plugin_infobar_delegates.cc

Issue 922953002: Minor infobar cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } else if (name == PluginMetadata::kAdobeReaderGroupName) { 128 } else if (name == PluginMetadata::kAdobeReaderGroupName) {
129 content::RecordAction( 129 content::RecordAction(
130 UserMetricsAction("OutdatedPluginInfobar.Shown.Reader")); 130 UserMetricsAction("OutdatedPluginInfobar.Shown.Reader"));
131 } 131 }
132 } 132 }
133 133
134 OutdatedPluginInfoBarDelegate::~OutdatedPluginInfoBarDelegate() { 134 OutdatedPluginInfoBarDelegate::~OutdatedPluginInfoBarDelegate() {
135 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed")); 135 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed"));
136 } 136 }
137 137
138 std::string OutdatedPluginInfoBarDelegate::GetLearnMoreURL() const { 138 void OutdatedPluginInfoBarDelegate::InfoBarDismissed() {
139 return chrome::kOutdatedPluginLearnMoreURL; 139 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Dismissed"));
140 } 140 }
141 141
142 base::string16 OutdatedPluginInfoBarDelegate::GetMessageText() const { 142 base::string16 OutdatedPluginInfoBarDelegate::GetMessageText() const {
143 return message_; 143 return message_;
144 } 144 }
145 145
146 base::string16 OutdatedPluginInfoBarDelegate::GetButtonLabel( 146 base::string16 OutdatedPluginInfoBarDelegate::GetButtonLabel(
147 InfoBarButton button) const { 147 InfoBarButton button) const {
148 return l10n_util::GetStringUTF16((button == BUTTON_OK) ? 148 return l10n_util::GetStringUTF16((button == BUTTON_OK) ?
149 IDS_PLUGIN_UPDATE : IDS_PLUGIN_ENABLE_TEMPORARILY); 149 IDS_PLUGIN_UPDATE : IDS_PLUGIN_ENABLE_TEMPORARILY);
(...skipping 15 matching lines...) Expand all
165 return false; 165 return false;
166 } 166 }
167 167
168 bool OutdatedPluginInfoBarDelegate::Cancel() { 168 bool OutdatedPluginInfoBarDelegate::Cancel() {
169 content::RecordAction( 169 content::RecordAction(
170 UserMetricsAction("OutdatedPluginInfobar.AllowThisTime")); 170 UserMetricsAction("OutdatedPluginInfobar.AllowThisTime"));
171 LoadBlockedPlugins(); 171 LoadBlockedPlugins();
172 return true; 172 return true;
173 } 173 }
174 174
175 void OutdatedPluginInfoBarDelegate::InfoBarDismissed() {
176 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Dismissed"));
177 }
178
179 bool OutdatedPluginInfoBarDelegate::LinkClicked( 175 bool OutdatedPluginInfoBarDelegate::LinkClicked(
180 WindowOpenDisposition disposition) { 176 WindowOpenDisposition disposition) {
181 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.LearnMore")); 177 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.LearnMore"));
182 return PluginInfoBarDelegate::LinkClicked(disposition); 178 return PluginInfoBarDelegate::LinkClicked(disposition);
183 } 179 }
184 180
181 std::string OutdatedPluginInfoBarDelegate::GetLearnMoreURL() const {
182 return chrome::kOutdatedPluginLearnMoreURL;
183 }
184
185 void OutdatedPluginInfoBarDelegate::DownloadStarted() { 185 void OutdatedPluginInfoBarDelegate::DownloadStarted() {
186 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOADING, 186 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOADING,
187 plugin_metadata_->name())); 187 plugin_metadata_->name()));
188 } 188 }
189 189
190 void OutdatedPluginInfoBarDelegate::DownloadError(const std::string& message) { 190 void OutdatedPluginInfoBarDelegate::DownloadError(const std::string& message) {
191 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_ERROR_SHORT, 191 ReplaceWithInfoBar(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_ERROR_SHORT,
192 plugin_metadata_->name())); 192 plugin_metadata_->name()));
193 } 193 }
194 194
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"), 436 "https://support.google.com/chrome/?p=ib_redirect_to_desktop"),
437 content::Referrer(), 437 content::Referrer(),
438 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 438 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
439 ui::PAGE_TRANSITION_LINK, false)); 439 ui::PAGE_TRANSITION_LINK, false));
440 return false; 440 return false;
441 } 441 }
442 442
443 #endif // defined(OS_WIN) 443 #endif // defined(OS_WIN)
444 444
445 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 445 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_infobar_delegates.h ('k') | chrome/browser/ssl/ssl_add_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698