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

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

Issue 2382563003: Remove some more desktop infobar PNGs. (Closed)
Patch Set: pkasting review Created 4 years, 2 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/pepper_broker_infobar_delegate.h" 5 #include "chrome/browser/pepper_broker_infobar_delegate.h"
6 6
7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
9 #include "chrome/browser/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/plugins/plugin_finder.h" 10 #include "chrome/browser/plugins/plugin_finder.h"
11 #include "chrome/browser/plugins/plugin_metadata.h" 11 #include "chrome/browser/plugins/plugin_metadata.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/grit/generated_resources.h" 13 #include "chrome/grit/generated_resources.h"
14 #include "chrome/grit/theme_resources.h"
15 #include "components/content_settings/core/browser/host_content_settings_map.h" 14 #include "components/content_settings/core/browser/host_content_settings_map.h"
16 #include "components/infobars/core/infobar.h" 15 #include "components/infobars/core/infobar.h"
17 #include "components/strings/grit/components_strings.h" 16 #include "components/strings/grit/components_strings.h"
18 #include "components/url_formatter/elide_url.h" 17 #include "components/url_formatter/elide_url.h"
19 #include "content/public/browser/page_navigator.h" 18 #include "content/public/browser/page_navigator.h"
20 #include "content/public/browser/plugin_service.h" 19 #include "content/public/browser/plugin_service.h"
21 #include "content/public/browser/user_metrics.h" 20 #include "content/public/browser/user_metrics.h"
22 #include "content/public/browser/web_contents.h" 21 #include "content/public/browser/web_contents.h"
23 #include "content/public/common/referrer.h" 22 #include "content/public/common/referrer.h"
24 #include "content/public/common/webplugininfo.h" 23 #include "content/public/common/webplugininfo.h"
25 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
26 25 #include "ui/gfx/vector_icons_public.h"
27 26
28 // static 27 // static
29 void PepperBrokerInfoBarDelegate::Create( 28 void PepperBrokerInfoBarDelegate::Create(
30 content::WebContents* web_contents, 29 content::WebContents* web_contents,
31 const GURL& url, 30 const GURL& url,
32 const base::FilePath& plugin_path, 31 const base::FilePath& plugin_path,
33 const base::Callback<void(bool)>& callback) { 32 const base::Callback<void(bool)>& callback) {
34 Profile* profile = 33 Profile* profile =
35 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 34 Profile::FromBrowserContext(web_contents->GetBrowserContext());
36 // TODO(wad): Add ephemeral device ID support for broker in guest mode. 35 // TODO(wad): Add ephemeral device ID support for broker in guest mode.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() { 85 PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() {
87 if (!callback_.is_null()) 86 if (!callback_.is_null())
88 callback_.Run(false); 87 callback_.Run(false);
89 } 88 }
90 89
91 infobars::InfoBarDelegate::InfoBarIdentifier 90 infobars::InfoBarDelegate::InfoBarIdentifier
92 PepperBrokerInfoBarDelegate::GetIdentifier() const { 91 PepperBrokerInfoBarDelegate::GetIdentifier() const {
93 return PEPPER_BROKER_INFOBAR_DELEGATE; 92 return PEPPER_BROKER_INFOBAR_DELEGATE;
94 } 93 }
95 94
96 int PepperBrokerInfoBarDelegate::GetIconId() const { 95 gfx::VectorIconId PepperBrokerInfoBarDelegate::GetVectorIconId() const {
97 return IDR_INFOBAR_PLUGIN_INSTALL; 96 return gfx::VectorIconId::EXTENSION;
98 } 97 }
99 98
100 base::string16 PepperBrokerInfoBarDelegate::GetMessageText() const { 99 base::string16 PepperBrokerInfoBarDelegate::GetMessageText() const {
101 content::PluginService* plugin_service = 100 content::PluginService* plugin_service =
102 content::PluginService::GetInstance(); 101 content::PluginService::GetInstance();
103 content::WebPluginInfo plugin; 102 content::WebPluginInfo plugin;
104 bool success = plugin_service->GetPluginInfoByPath(plugin_path_, &plugin); 103 bool success = plugin_service->GetPluginInfoByPath(plugin_path_, &plugin);
105 DCHECK(success); 104 DCHECK(success);
106 std::unique_ptr<PluginMetadata> plugin_metadata( 105 std::unique_ptr<PluginMetadata> plugin_metadata(
107 PluginFinder::GetInstance()->GetPluginMetadata(plugin)); 106 PluginFinder::GetInstance()->GetPluginMetadata(plugin));
(...skipping 30 matching lines...) Expand all
138 content::RecordAction(result ? 137 content::RecordAction(result ?
139 base::UserMetricsAction("PPAPI.BrokerInfobarClickedAllow") : 138 base::UserMetricsAction("PPAPI.BrokerInfobarClickedAllow") :
140 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); 139 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny"));
141 callback_.Run(result); 140 callback_.Run(result);
142 callback_ = base::Callback<void(bool)>(); 141 callback_ = base::Callback<void(bool)>();
143 content_settings_->SetContentSettingDefaultScope( 142 content_settings_->SetContentSettingDefaultScope(
144 url_, GURL(), CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string(), 143 url_, GURL(), CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string(),
145 result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); 144 result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
146 tab_content_settings_->SetPepperBrokerAllowed(result); 145 tab_content_settings_->SetPepperBrokerAllowed(result);
147 } 146 }
OLDNEW
« no previous file with comments | « chrome/browser/pepper_broker_infobar_delegate.h ('k') | chrome/browser/permissions/permission_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698