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") : |