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

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

Issue 10918174: Remove PluginGroup (Closed) Base URL: http://git.chromium.org/chromium/src.git@remove_async_plugin_finder
Patch Set: Created 8 years, 3 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/plugin_infobar_delegates.h" 5 #include "chrome/browser/plugin_infobar_delegates.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/api/infobars/infobar_service.h" 8 #include "chrome/browser/api/infobars/infobar_service.h"
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/google/google_util.h" 10 #include "chrome/browser/google/google_util.h"
11 #include "chrome/browser/lifetime/application_lifetime.h" 11 #include "chrome/browser/lifetime/application_lifetime.h"
12 #include "chrome/browser/plugin_metadata.h"
12 #include "chrome/browser/plugin_observer.h" 13 #include "chrome/browser/plugin_observer.h"
13 #include "chrome/browser/ui/tab_contents/tab_contents.h" 14 #include "chrome/browser/ui/tab_contents/tab_contents.h"
14 #include "chrome/common/render_messages.h" 15 #include "chrome/common/render_messages.h"
15 #include "chrome/common/url_constants.h" 16 #include "chrome/common/url_constants.h"
16 #include "content/public/browser/render_view_host.h" 17 #include "content/public/browser/render_view_host.h"
17 #include "content/public/browser/user_metrics.h" 18 #include "content/public/browser/user_metrics.h"
18 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
19 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
20 #include "grit/locale_settings.h" 21 #include "grit/locale_settings.h"
21 #include "grit/theme_resources.h" 22 #include "grit/theme_resources.h"
22 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
24 #include "webkit/plugins/npapi/plugin_group.h"
25 25
26 #if defined(OS_WIN) 26 #if defined(OS_WIN)
27 #include <shellapi.h> 27 #include <shellapi.h>
28 #include "ui/base/win/shell.h" 28 #include "ui/base/win/shell.h"
29 #endif 29 #endif
30 30
31 #if defined(ENABLE_PLUGIN_INSTALLATION) 31 #if defined(ENABLE_PLUGIN_INSTALLATION)
32 #include "chrome/browser/plugin_installer.h" 32 #include "chrome/browser/plugin_installer.h"
33 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 33 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
34 34
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 UnauthorizedPluginInfoBarDelegate::UnauthorizedPluginInfoBarDelegate( 79 UnauthorizedPluginInfoBarDelegate::UnauthorizedPluginInfoBarDelegate(
80 InfoBarService* infobar_service, 80 InfoBarService* infobar_service,
81 HostContentSettingsMap* content_settings, 81 HostContentSettingsMap* content_settings,
82 const string16& utf16_name, 82 const string16& utf16_name,
83 const std::string& identifier) 83 const std::string& identifier)
84 : PluginInfoBarDelegate(infobar_service, utf16_name, identifier), 84 : PluginInfoBarDelegate(infobar_service, utf16_name, identifier),
85 content_settings_(content_settings) { 85 content_settings_(content_settings) {
86 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown")); 86 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown"));
87 std::string name = UTF16ToUTF8(utf16_name); 87 std::string name = UTF16ToUTF8(utf16_name);
88 if (name == webkit::npapi::PluginGroup::kJavaGroupName) 88 if (name == PluginMetadata::kJavaGroupName)
89 content::RecordAction( 89 content::RecordAction(
90 UserMetricsAction("BlockedPluginInfobar.Shown.Java")); 90 UserMetricsAction("BlockedPluginInfobar.Shown.Java"));
91 else if (name == webkit::npapi::PluginGroup::kQuickTimeGroupName) 91 else if (name == PluginMetadata::kQuickTimeGroupName)
92 content::RecordAction( 92 content::RecordAction(
93 UserMetricsAction("BlockedPluginInfobar.Shown.QuickTime")); 93 UserMetricsAction("BlockedPluginInfobar.Shown.QuickTime"));
94 else if (name == webkit::npapi::PluginGroup::kShockwaveGroupName) 94 else if (name == PluginMetadata::kShockwaveGroupName)
95 content::RecordAction( 95 content::RecordAction(
96 UserMetricsAction("BlockedPluginInfobar.Shown.Shockwave")); 96 UserMetricsAction("BlockedPluginInfobar.Shown.Shockwave"));
97 else if (name == webkit::npapi::PluginGroup::kRealPlayerGroupName) 97 else if (name == PluginMetadata::kRealPlayerGroupName)
98 content::RecordAction( 98 content::RecordAction(
99 UserMetricsAction("BlockedPluginInfobar.Shown.RealPlayer")); 99 UserMetricsAction("BlockedPluginInfobar.Shown.RealPlayer"));
100 else if (name == webkit::npapi::PluginGroup::kWindowsMediaPlayerGroupName) 100 else if (name == PluginMetadata::kWindowsMediaPlayerGroupName)
101 content::RecordAction( 101 content::RecordAction(
102 UserMetricsAction("BlockedPluginInfobar.Shown.WindowsMediaPlayer")); 102 UserMetricsAction("BlockedPluginInfobar.Shown.WindowsMediaPlayer"));
103 } 103 }
104 104
105 UnauthorizedPluginInfoBarDelegate::~UnauthorizedPluginInfoBarDelegate() { 105 UnauthorizedPluginInfoBarDelegate::~UnauthorizedPluginInfoBarDelegate() {
106 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Closed")); 106 content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Closed"));
107 } 107 }
108 108
109 std::string UnauthorizedPluginInfoBarDelegate::GetLearnMoreURL() const { 109 std::string UnauthorizedPluginInfoBarDelegate::GetLearnMoreURL() const {
110 return chrome::kBlockedPluginLearnMoreURL; 110 return chrome::kBlockedPluginLearnMoreURL;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 PluginInstaller* installer, 177 PluginInstaller* installer,
178 const string16& message) 178 const string16& message)
179 : PluginInfoBarDelegate(InfoBarService::ForTab(observer->tab_contents()), 179 : PluginInfoBarDelegate(InfoBarService::ForTab(observer->tab_contents()),
180 installer->name(), 180 installer->name(),
181 installer->identifier()), 181 installer->identifier()),
182 WeakPluginInstallerObserver(installer), 182 WeakPluginInstallerObserver(installer),
183 observer_(observer), 183 observer_(observer),
184 message_(message) { 184 message_(message) {
185 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Shown")); 185 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Shown"));
186 std::string name = UTF16ToUTF8(installer->name()); 186 std::string name = UTF16ToUTF8(installer->name());
187 if (name == webkit::npapi::PluginGroup::kJavaGroupName) 187 if (name == PluginMetadata::kJavaGroupName)
188 content::RecordAction( 188 content::RecordAction(
189 UserMetricsAction("OutdatedPluginInfobar.Shown.Java")); 189 UserMetricsAction("OutdatedPluginInfobar.Shown.Java"));
190 else if (name == webkit::npapi::PluginGroup::kQuickTimeGroupName) 190 else if (name == PluginMetadata::kQuickTimeGroupName)
191 content::RecordAction( 191 content::RecordAction(
192 UserMetricsAction("OutdatedPluginInfobar.Shown.QuickTime")); 192 UserMetricsAction("OutdatedPluginInfobar.Shown.QuickTime"));
193 else if (name == webkit::npapi::PluginGroup::kShockwaveGroupName) 193 else if (name == PluginMetadata::kShockwaveGroupName)
194 content::RecordAction( 194 content::RecordAction(
195 UserMetricsAction("OutdatedPluginInfobar.Shown.Shockwave")); 195 UserMetricsAction("OutdatedPluginInfobar.Shown.Shockwave"));
196 else if (name == webkit::npapi::PluginGroup::kRealPlayerGroupName) 196 else if (name == PluginMetadata::kRealPlayerGroupName)
197 content::RecordAction( 197 content::RecordAction(
198 UserMetricsAction("OutdatedPluginInfobar.Shown.RealPlayer")); 198 UserMetricsAction("OutdatedPluginInfobar.Shown.RealPlayer"));
199 else if (name == webkit::npapi::PluginGroup::kSilverlightGroupName) 199 else if (name == PluginMetadata::kSilverlightGroupName)
200 content::RecordAction( 200 content::RecordAction(
201 UserMetricsAction("OutdatedPluginInfobar.Shown.Silverlight")); 201 UserMetricsAction("OutdatedPluginInfobar.Shown.Silverlight"));
202 else if (name == webkit::npapi::PluginGroup::kAdobeReaderGroupName) 202 else if (name == PluginMetadata::kAdobeReaderGroupName)
203 content::RecordAction( 203 content::RecordAction(
204 UserMetricsAction("OutdatedPluginInfobar.Shown.Reader")); 204 UserMetricsAction("OutdatedPluginInfobar.Shown.Reader"));
205 } 205 }
206 206
207 OutdatedPluginInfoBarDelegate::~OutdatedPluginInfoBarDelegate() { 207 OutdatedPluginInfoBarDelegate::~OutdatedPluginInfoBarDelegate() {
208 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed")); 208 content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Closed"));
209 } 209 }
210 210
211 std::string OutdatedPluginInfoBarDelegate::GetLearnMoreURL() const { 211 std::string OutdatedPluginInfoBarDelegate::GetLearnMoreURL() const {
212 return chrome::kOutdatedPluginLearnMoreURL; 212 return chrome::kOutdatedPluginLearnMoreURL;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 "https://support.google.com/chrome/?ib_display_in_desktop")); 482 "https://support.google.com/chrome/?ib_display_in_desktop"));
483 OpenURLParams params( 483 OpenURLParams params(
484 url, Referrer(), 484 url, Referrer(),
485 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 485 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
486 content::PAGE_TRANSITION_LINK, false); 486 content::PAGE_TRANSITION_LINK, false);
487 owner()->GetWebContents()->OpenURL(params); 487 owner()->GetWebContents()->OpenURL(params);
488 return false; 488 return false;
489 } 489 }
490 #endif // defined(OS_WIN) 490 #endif // defined(OS_WIN)
491 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 491 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698