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

Unified Diff: chrome/browser/pepper_broker_infobar_delegate.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/pepper_broker_infobar_delegate.h ('k') | chrome/browser/plugins/plugin_infobar_delegates.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/pepper_broker_infobar_delegate.cc
===================================================================
--- chrome/browser/pepper_broker_infobar_delegate.cc (revision 175396)
+++ chrome/browser/pepper_broker_infobar_delegate.cc (working copy)
@@ -32,7 +32,7 @@
using content::WebContents;
// static
-void PepperBrokerInfoBarDelegate::Show(
+void PepperBrokerInfoBarDelegate::Create(
WebContents* web_contents,
const GURL& url,
const FilePath& plugin_path,
@@ -72,10 +72,10 @@
InfoBarService::FromWebContents(web_contents);
std::string languages =
profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
- infobar_service->AddInfoBar(
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
new PepperBrokerInfoBarDelegate(
infobar_service, url, plugin_path, languages, content_settings,
- callback));
+ callback)));
break;
}
default:
@@ -83,26 +83,6 @@
}
}
-PepperBrokerInfoBarDelegate::PepperBrokerInfoBarDelegate(
- InfoBarService* infobar_service,
- const GURL& url,
- const FilePath& plugin_path,
- const std::string& languages,
- HostContentSettingsMap* content_settings,
- const base::Callback<void(bool)>& callback)
- : ConfirmInfoBarDelegate(infobar_service),
- url_(url),
- plugin_path_(plugin_path),
- languages_(languages),
- content_settings_(content_settings),
- callback_(callback) {
-}
-
-PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() {
- if (!callback_.is_null())
- callback_.Run(false);
-}
-
string16 PepperBrokerInfoBarDelegate::GetMessageText() const {
content::PluginService* plugin_service =
content::PluginService::GetInstance();
@@ -164,6 +144,26 @@
IDR_INFOBAR_PLUGIN_INSTALL);
}
+PepperBrokerInfoBarDelegate::PepperBrokerInfoBarDelegate(
+ InfoBarService* infobar_service,
+ const GURL& url,
+ const FilePath& plugin_path,
+ const std::string& languages,
+ HostContentSettingsMap* content_settings,
+ const base::Callback<void(bool)>& callback)
+ : ConfirmInfoBarDelegate(infobar_service),
+ url_(url),
+ plugin_path_(plugin_path),
+ languages_(languages),
+ content_settings_(content_settings),
+ callback_(callback) {
+}
+
+PepperBrokerInfoBarDelegate::~PepperBrokerInfoBarDelegate() {
+ if (!callback_.is_null())
+ callback_.Run(false);
+}
+
void PepperBrokerInfoBarDelegate::DispatchCallback(bool result) {
content::RecordAction(result ?
content::UserMetricsAction("PPAPI.BrokerInfobarClickedAllow") :
« no previous file with comments | « chrome/browser/pepper_broker_infobar_delegate.h ('k') | chrome/browser/plugins/plugin_infobar_delegates.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698