diff options
Diffstat (limited to 'chrome/browser')
44 files changed, 99 insertions, 78 deletions
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc index a44a1b3..430a79c 100644 --- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc +++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc @@ -26,7 +26,7 @@ void AutofillCCInfoBarDelegate::Create( InfoBarService* infobar_service, const base::Closure& save_card_callback) { infobar_service->AddInfoBar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new AutofillCCInfoBarDelegate(save_card_callback)))); } diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc index d853aff..69fef1f 100644 --- a/chrome/browser/chrome_quota_permission_context.cc +++ b/chrome/browser/chrome_quota_permission_context.cc @@ -188,7 +188,7 @@ void RequestQuotaInfoBarDelegate::Create( int64 requested_quota, const std::string& display_languages, const content::QuotaPermissionContext::PermissionCallback& callback) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new RequestQuotaInfoBarDelegate( context, origin_url, requested_quota, display_languages, callback)))); } diff --git a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc index 6e06332..e25ba6b 100644 --- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc +++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc @@ -24,7 +24,7 @@ void RegisterProtocolHandlerInfoBarDelegate::Create( base::UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown")); scoped_ptr<infobars::InfoBar> infobar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new RegisterProtocolHandlerInfoBarDelegate(registry, handler)))); for (size_t i = 0; i < infobar_service->infobar_count(); ++i) { diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc index 3c06f94..94de948 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.cc +++ b/chrome/browser/devtools/devtools_ui_bindings.cc @@ -145,8 +145,8 @@ void DevToolsConfirmInfoBarDelegate::Create( return; } - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new DevToolsConfirmInfoBarDelegate(callback, message)))); } diff --git a/chrome/browser/download/download_request_infobar_delegate.cc b/chrome/browser/download/download_request_infobar_delegate.cc index 85cf2e1..d2d7954 100644 --- a/chrome/browser/download/download_request_infobar_delegate.cc +++ b/chrome/browser/download/download_request_infobar_delegate.cc @@ -36,7 +36,7 @@ void DownloadRequestInfoBarDelegate::Create( // "downloads" permission) to automatically download >1 files. host->Cancel(); } else { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>( new DownloadRequestInfoBarDelegate(host)))); } diff --git a/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc b/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc index 6c475e4..2fa0086 100644 --- a/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc +++ b/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc @@ -31,7 +31,7 @@ class CryptotokenPermissionInfoBarDelegate : public ConfirmInfoBarDelegate { static void Create(InfoBarService* infobar_service, const base::string16& message, const InfoBarCallback& callback) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>( new CryptotokenPermissionInfoBarDelegate(message, callback)))); } diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc index dfd2ff8..811d5dd 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.cc +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc @@ -195,8 +195,8 @@ infobars::InfoBar* ExtensionDevToolsInfoBarDelegate::Create( if (!infobar_service) return NULL; - return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + return infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new ExtensionDevToolsInfoBarDelegate(client_name)))); } diff --git a/chrome/browser/extensions/api/messaging/incognito_connectability.cc b/chrome/browser/extensions/api/messaging/incognito_connectability.cc index 177ba48..5c56a75 100644 --- a/chrome/browser/extensions/api/messaging/incognito_connectability.cc +++ b/chrome/browser/extensions/api/messaging/incognito_connectability.cc @@ -38,7 +38,7 @@ class IncognitoConnectabilityInfoBarDelegate : public ConfirmInfoBarDelegate { static InfoBar* Create(InfoBarManager* infobar_manager, const base::string16& message, const InfoBarCallback& callback) { - return infobar_manager->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + return infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>( new IncognitoConnectabilityInfoBarDelegate(message, callback)))); } diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc index 2536f53..7731563 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc @@ -50,11 +50,11 @@ void ThemeInstalledInfoBarDelegate::Create( InfoBarService::FromWebContents(web_contents); ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile); scoped_ptr<infobars::InfoBar> new_infobar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( - new ThemeInstalledInfoBarDelegate( + infobar_service->CreateConfirmInfoBar( + scoped_ptr<ConfirmInfoBarDelegate>(new ThemeInstalledInfoBarDelegate( extensions::ExtensionSystem::Get(profile)->extension_service(), - theme_service, new_theme, - previous_theme_id, previous_using_system_theme)))); + theme_service, new_theme, previous_theme_id, + previous_using_system_theme)))); // If there's a previous theme infobar, just replace that instead of adding a // new one. diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc index 8de4df8..b69acf0 100644 --- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc +++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc @@ -35,9 +35,8 @@ infobars::InfoBar* GeolocationInfoBarDelegate::Create( committed_entry ? committed_entry->GetUniqueID() : 0, display_languages); - infobars::InfoBar* infobar = ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>(delegate)).release(); - return infobar_service->AddInfoBar(scoped_ptr<infobars::InfoBar>(infobar)); + return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( + scoped_ptr<ConfirmInfoBarDelegate>(delegate))); } GeolocationInfoBarDelegate::GeolocationInfoBarDelegate( diff --git a/chrome/browser/gpu/three_d_api_observer.cc b/chrome/browser/gpu/three_d_api_observer.cc index d2f8d8e..7396f85 100644 --- a/chrome/browser/gpu/three_d_api_observer.cc +++ b/chrome/browser/gpu/three_d_api_observer.cc @@ -63,8 +63,8 @@ void ThreeDAPIInfoBarDelegate::Create(InfoBarService* infobar_service, content::ThreeDAPIType requester) { if (!infobar_service) return; // NULL for apps. - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new ThreeDAPIInfoBarDelegate(url, requester)))); } diff --git a/chrome/browser/infobars/infobar_service.cc b/chrome/browser/infobars/infobar_service.cc index 5037cc8..3e80ac9 100644 --- a/chrome/browser/infobars/infobar_service.cc +++ b/chrome/browser/infobars/infobar_service.cc @@ -95,6 +95,9 @@ void InfoBarService::NotifyInfoBarRemoved(InfoBar* infobar, bool animate) { content::Details<InfoBar::RemovedDetails>(&removed_details)); } +// InfoBarService::CreateConfirmInfoBar() is implemented in platform-specific +// files. + void InfoBarService::RenderProcessGone(base::TerminationStatus status) { RemoveAllInfoBars(true); } diff --git a/chrome/browser/infobars/infobar_service.h b/chrome/browser/infobars/infobar_service.h index 985b7c0a..19d5ec2 100644 --- a/chrome/browser/infobars/infobar_service.h +++ b/chrome/browser/infobars/infobar_service.h @@ -45,6 +45,12 @@ class InfoBarService : public infobars::InfoBarManager, // changes. void set_ignore_next_reload() { ignore_next_reload_ = true; } + // InfoBarManager: + // TODO(sdefresne): Change clients to invoke this on infobars::InfoBarManager + // and turn the method override private. + scoped_ptr<infobars::InfoBar> CreateConfirmInfoBar( + scoped_ptr<ConfirmInfoBarDelegate> delegate) override; + private: friend class content::WebContentsUserData<InfoBarService>; diff --git a/chrome/browser/infobars/insecure_content_infobar_delegate.cc b/chrome/browser/infobars/insecure_content_infobar_delegate.cc index fa90ef461..f95bd13 100644 --- a/chrome/browser/infobars/insecure_content_infobar_delegate.cc +++ b/chrome/browser/infobars/insecure_content_infobar_delegate.cc @@ -22,7 +22,7 @@ void InsecureContentInfoBarDelegate::Create(InfoBarService* infobar_service, InfoBarType type) { scoped_ptr<infobars::InfoBar> new_infobar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new InsecureContentInfoBarDelegate(type)))); // Only supsersede an existing insecure content infobar if we are upgrading diff --git a/chrome/browser/infobars/simple_alert_infobar_delegate.cc b/chrome/browser/infobars/simple_alert_infobar_delegate.cc index fa15f36..02b71b0 100644 --- a/chrome/browser/infobars/simple_alert_infobar_delegate.cc +++ b/chrome/browser/infobars/simple_alert_infobar_delegate.cc @@ -13,8 +13,8 @@ void SimpleAlertInfoBarDelegate::Create(InfoBarService* infobar_service, int icon_id, const base::string16& message, bool auto_expire) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new SimpleAlertInfoBarDelegate(icon_id, message, auto_expire)))); } diff --git a/chrome/browser/media/media_stream_infobar_delegate.cc b/chrome/browser/media/media_stream_infobar_delegate.cc index 860b2dc..7db4ea4 100644 --- a/chrome/browser/media/media_stream_infobar_delegate.cc +++ b/chrome/browser/media/media_stream_infobar_delegate.cc @@ -53,7 +53,7 @@ bool MediaStreamInfoBarDelegate::Create( } scoped_ptr<infobars::InfoBar> infobar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new MediaStreamInfoBarDelegate(controller.Pass())))); for (size_t i = 0; i < infobar_service->infobar_count(); ++i) { infobars::InfoBar* old_infobar = infobar_service->infobar_at(i); diff --git a/chrome/browser/media/midi_permission_infobar_delegate.cc b/chrome/browser/media/midi_permission_infobar_delegate.cc index eb1019a..a90cdf6 100644 --- a/chrome/browser/media/midi_permission_infobar_delegate.cc +++ b/chrome/browser/media/midi_permission_infobar_delegate.cc @@ -26,7 +26,7 @@ infobars::InfoBar* MidiPermissionInfoBarDelegate::Create( ContentSettingsType type) { const content::NavigationEntry* committed_entry = infobar_service->web_contents()->GetController().GetLastCommittedEntry(); - return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new MidiPermissionInfoBarDelegate( controller, id, requesting_frame, committed_entry ? committed_entry->GetUniqueID() : 0, diff --git a/chrome/browser/media/protected_media_identifier_infobar_delegate.cc b/chrome/browser/media/protected_media_identifier_infobar_delegate.cc index b3b6db3..de5f743 100644 --- a/chrome/browser/media/protected_media_identifier_infobar_delegate.cc +++ b/chrome/browser/media/protected_media_identifier_infobar_delegate.cc @@ -26,8 +26,8 @@ infobars::InfoBar* ProtectedMediaIdentifierInfoBarDelegate::Create( const std::string& display_languages) { const content::NavigationEntry* committed_entry = infobar_service->web_contents()->GetController().GetLastCommittedEntry(); - return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + return infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new ProtectedMediaIdentifierInfoBarDelegate( controller, id, requesting_frame, committed_entry ? committed_entry->GetUniqueID() : 0, diff --git a/chrome/browser/nacl_host/nacl_infobar_delegate.cc b/chrome/browser/nacl_host/nacl_infobar_delegate.cc index 2836dd3..c7047e2 100644 --- a/chrome/browser/nacl_host/nacl_infobar_delegate.cc +++ b/chrome/browser/nacl_host/nacl_infobar_delegate.cc @@ -27,7 +27,7 @@ void NaClInfoBarDelegate::Create(int render_process_id, int render_view_id) { InfoBarService* infobar_service = InfoBarService::FromWebContents(web_contents); if (infobar_service) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new NaClInfoBarDelegate()))); } } diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc index beae67f..86e0309 100644 --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc @@ -16,8 +16,11 @@ // static void DataReductionProxyInfoBarDelegate::Create( content::WebContents* web_contents, const std::string& link_url) { - InfoBarService::FromWebContents(web_contents)->AddInfoBar( + InfoBarService* infobar_service = + InfoBarService::FromWebContents(web_contents); + infobar_service->AddInfoBar( DataReductionProxyInfoBarDelegate::CreateInfoBar( + infobar_service, scoped_ptr<DataReductionProxyInfoBarDelegate>( new DataReductionProxyInfoBarDelegate(link_url)))); } @@ -27,8 +30,9 @@ void DataReductionProxyInfoBarDelegate::Create( // static scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar( + infobars::InfoBarManager* infobar_manager, scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) { - return ConfirmInfoBarDelegate::CreateInfoBar(delegate.Pass()); + return infobar_manager->CreateConfirmInfoBar(delegate.Pass()); } #endif diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h b/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h index 85516b9..4a5698b 100644 --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h @@ -14,6 +14,10 @@ namespace content { class WebContents; } +namespace infobars { +class InfoBarManager; +} + // Configures an InfoBar with no buttons that stays visible until it is // explicitly dismissed. This InfoBar is suitable for displaying a message // and a link, and is used only by an Android field trial. @@ -30,6 +34,7 @@ class DataReductionProxyInfoBarDelegate : public ConfirmInfoBarDelegate { // Returns a Data Reduction Proxy infobar that owns |delegate|. static scoped_ptr<infobars::InfoBar> CreateInfoBar( + infobars::InfoBarManager* infobar_manager, scoped_ptr<DataReductionProxyInfoBarDelegate> delegate); // ConfirmInfoBarDelegate diff --git a/chrome/browser/notifications/desktop_notification_infobar_delegate.cc b/chrome/browser/notifications/desktop_notification_infobar_delegate.cc index c68fe28..eb34214 100644 --- a/chrome/browser/notifications/desktop_notification_infobar_delegate.cc +++ b/chrome/browser/notifications/desktop_notification_infobar_delegate.cc @@ -26,7 +26,7 @@ infobars::InfoBar* DesktopNotificationInfoBarDelegate::Create( const std::string& display_languages) { const content::NavigationEntry* committed_entry = infobar_service->web_contents()->GetController().GetLastCommittedEntry(); - return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new DesktopNotificationInfoBarDelegate( controller, id, requesting_frame, committed_entry ? committed_entry->GetUniqueID() : 0, diff --git a/chrome/browser/password_manager/save_password_infobar_delegate.cc b/chrome/browser/password_manager/save_password_infobar_delegate.cc index 93d79a9..09f925d 100644 --- a/chrome/browser/password_manager/save_password_infobar_delegate.cc +++ b/chrome/browser/password_manager/save_password_infobar_delegate.cc @@ -46,10 +46,11 @@ void SavePasswordInfoBarDelegate::Create( return; #endif - InfoBarService::FromWebContents(web_contents)->AddInfoBar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( - new SavePasswordInfoBarDelegate(form_to_save.Pass(), - uma_histogram_suffix)))); + InfoBarService* infobar_service = + InfoBarService::FromWebContents(web_contents); + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( + scoped_ptr<ConfirmInfoBarDelegate>(new SavePasswordInfoBarDelegate( + form_to_save.Pass(), uma_histogram_suffix)))); } SavePasswordInfoBarDelegate::~SavePasswordInfoBarDelegate() { diff --git a/chrome/browser/pepper_broker_infobar_delegate.cc b/chrome/browser/pepper_broker_infobar_delegate.cc index 4a77180..ca7a597 100644 --- a/chrome/browser/pepper_broker_infobar_delegate.cc +++ b/chrome/browser/pepper_broker_infobar_delegate.cc @@ -55,7 +55,7 @@ void PepperBrokerInfoBarDelegate::Create( base::UserMetricsAction("PPAPI.BrokerInfobarDisplayed")); InfoBarService* infobar_service = InfoBarService::FromWebContents(web_contents); - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new PepperBrokerInfoBarDelegate( url, plugin_path, profile->GetPrefs()->GetString(prefs::kAcceptLanguages), diff --git a/chrome/browser/plugins/plugin_infobar_delegates.cc b/chrome/browser/plugins/plugin_infobar_delegates.cc index 789b278..ead6040 100644 --- a/chrome/browser/plugins/plugin_infobar_delegates.cc +++ b/chrome/browser/plugins/plugin_infobar_delegates.cc @@ -91,9 +91,10 @@ void OutdatedPluginInfoBarDelegate::Create( // Copy the name out of |plugin_metadata| now, since the Pass() call below // will make it impossible to get at. base::string16 name(plugin_metadata->name()); - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new OutdatedPluginInfoBarDelegate( - installer, plugin_metadata.Pass(), l10n_util::GetStringFUTF16( + installer, plugin_metadata.Pass(), + l10n_util::GetStringFUTF16( (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? IDS_PLUGIN_OUTDATED_PROMPT : IDS_PLUGIN_DOWNLOADING, name))))); @@ -232,13 +233,13 @@ void PluginInstallerInfoBarDelegate::Create( return; } #endif - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new PluginInstallerInfoBarDelegate( installer, plugin_metadata.Pass(), callback, true, l10n_util::GetStringFUTF16( - (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? - IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT : - IDS_PLUGIN_DOWNLOADING, + (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) + ? IDS_PLUGININSTALLER_INSTALLPLUGIN_PROMPT + : IDS_PLUGIN_DOWNLOADING, name))))); } @@ -249,9 +250,10 @@ void PluginInstallerInfoBarDelegate::Replace( bool new_install, const base::string16& message) { DCHECK(infobar->owner()); - infobar->owner()->ReplaceInfoBar(infobar, - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( - new PluginInstallerInfoBarDelegate( + infobar->owner()->ReplaceInfoBar( + infobar, + infobar->owner()->CreateConfirmInfoBar( + scoped_ptr<ConfirmInfoBarDelegate>(new PluginInstallerInfoBarDelegate( installer, plugin_metadata.Pass(), PluginInstallerInfoBarDelegate::InstallCallback(), new_install, message)))); @@ -365,8 +367,8 @@ void PluginMetroModeInfoBarDelegate::Create( InfoBarService* infobar_service, PluginMetroModeInfoBarDelegate::Mode mode, const base::string16& name) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new PluginMetroModeInfoBarDelegate(mode, name)))); } diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc index 69c5a46..fd6a8f5 100644 --- a/chrome/browser/plugins/plugin_observer.cc +++ b/chrome/browser/plugins/plugin_observer.cc @@ -150,7 +150,7 @@ void ReloadPluginInfoBarDelegate::Create( content::NavigationController* controller, const base::string16& message) { infobar_service->AddInfoBar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new ReloadPluginInfoBarDelegate(controller, message)))); } diff --git a/chrome/browser/ssl/ssl_add_certificate.cc b/chrome/browser/ssl/ssl_add_certificate.cc index bac7ee5..404416d 100644 --- a/chrome/browser/ssl/ssl_add_certificate.cc +++ b/chrome/browser/ssl/ssl_add_certificate.cc @@ -35,7 +35,7 @@ class SSLAddCertificateInfoBarDelegate : public ConfirmInfoBarDelegate { // Creates an SSL certificate enrollment result infobar and delegate. static void Create(InfoBarService* infobar_service, net::X509Certificate* cert) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>( new SSLAddCertificateInfoBarDelegate(cert)))); } diff --git a/chrome/browser/supervised_user/supervised_user_navigation_observer.cc b/chrome/browser/supervised_user/supervised_user_navigation_observer.cc index 5287940..163081e 100644 --- a/chrome/browser/supervised_user/supervised_user_navigation_observer.cc +++ b/chrome/browser/supervised_user/supervised_user_navigation_observer.cc @@ -100,8 +100,8 @@ class SupervisedUserWarningInfoBarDelegate : public ConfirmInfoBarDelegate { // static infobars::InfoBar* SupervisedUserWarningInfoBarDelegate::Create( InfoBarService* infobar_service) { - return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + return infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new SupervisedUserWarningInfoBarDelegate()))); } diff --git a/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc b/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc index ad395ce..e3686d7 100644 --- a/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc +++ b/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc @@ -23,12 +23,12 @@ void PopupBlockedInfoBarDelegate::Create(content::WebContents* web_contents, const GURL& url = web_contents->GetURL(); Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext()); - scoped_ptr<infobars::InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar( + InfoBarService* infobar_service = + InfoBarService::FromWebContents(web_contents); + scoped_ptr<infobars::InfoBar> infobar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new PopupBlockedInfoBarDelegate( num_popups, url, profile->GetHostContentSettingsMap())))); - InfoBarService* infobar_service = - InfoBarService::FromWebContents(web_contents); // See if there is an existing popup infobar already. // TODO(dfalcantara) When triggering more than one popup the infobar // will be shown once, then hide then be shown again. diff --git a/chrome/browser/ui/android/infobars/confirm_infobar.cc b/chrome/browser/ui/android/infobars/confirm_infobar.cc index 5db7823..8c7b3bc 100644 --- a/chrome/browser/ui/android/infobars/confirm_infobar.cc +++ b/chrome/browser/ui/android/infobars/confirm_infobar.cc @@ -8,14 +8,13 @@ #include "base/android/jni_string.h" #include "base/logging.h" #include "chrome/browser/android/resource_mapper.h" +#include "chrome/browser/infobars/infobar_service.h" #include "components/infobars/core/confirm_infobar_delegate.h" #include "jni/ConfirmInfoBarDelegate_jni.h" +// InfoBarService ------------------------------------------------------------- -// ConfirmInfoBarDelegate ----------------------------------------------------- - -// static -scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( +scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate> delegate) { return make_scoped_ptr(new ConfirmInfoBar(delegate.Pass())); } diff --git a/chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc b/chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc index 4389c92..57e295e 100644 --- a/chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc +++ b/chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc @@ -58,6 +58,7 @@ DataReductionProxyInfoBarDelegate* DataReductionProxyInfoBar::GetDelegate() { // static scoped_ptr<infobars::InfoBar> DataReductionProxyInfoBarDelegate::CreateInfoBar( + infobars::InfoBarManager* infobar_manager, scoped_ptr<DataReductionProxyInfoBarDelegate> delegate) { return scoped_ptr<infobars::InfoBar>( new DataReductionProxyInfoBar(delegate.Pass())); diff --git a/chrome/browser/ui/auto_login_infobar_delegate.cc b/chrome/browser/ui/auto_login_infobar_delegate.cc index 15e12c8..c4e20c0 100644 --- a/chrome/browser/ui/auto_login_infobar_delegate.cc +++ b/chrome/browser/ui/auto_login_infobar_delegate.cc @@ -136,7 +136,7 @@ bool AutoLoginInfoBarDelegate::Create(content::WebContents* web_contents, Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext()); typedef AutoLoginInfoBarDelegate Delegate; - return !!infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + return !!infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new Delegate(params, profile)))); } diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm index b541175..6affa4e 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm @@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/strings/sys_string_conversions.h" +#include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" #include "components/infobars/core/confirm_infobar_delegate.h" #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTweaker.h" @@ -137,8 +138,7 @@ @end -// static -scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( +scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate> delegate) { scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); base::scoped_nsobject<ConfirmInfoBarController> controller( diff --git a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm index afe3143..93864c0 100644 --- a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm +++ b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm @@ -81,7 +81,7 @@ void KeystonePromotionInfoBarDelegate::Create() { return; InfoBarService* infobar_service = InfoBarService::FromWebContents(webContents); - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new KeystonePromotionInfoBarDelegate( Profile::FromBrowserContext( webContents->GetBrowserContext())->GetPrefs())))); diff --git a/chrome/browser/ui/collected_cookies_infobar_delegate.cc b/chrome/browser/ui/collected_cookies_infobar_delegate.cc index d1c8174..6aed4d5 100644 --- a/chrome/browser/ui/collected_cookies_infobar_delegate.cc +++ b/chrome/browser/ui/collected_cookies_infobar_delegate.cc @@ -15,8 +15,8 @@ // static void CollectedCookiesInfoBarDelegate::Create(InfoBarService* infobar_service) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new CollectedCookiesInfoBarDelegate()))); } diff --git a/chrome/browser/ui/extensions/extension_install_ui_default.cc b/chrome/browser/ui/extensions/extension_install_ui_default.cc index fca3f02..febe8c0 100644 --- a/chrome/browser/ui/extensions/extension_install_ui_default.cc +++ b/chrome/browser/ui/extensions/extension_install_ui_default.cc @@ -96,7 +96,7 @@ class ErrorInfoBarDelegate : public ConfirmInfoBarDelegate { // static void ErrorInfoBarDelegate::Create(InfoBarService* infobar_service, const extensions::CrxInstallerError& error) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new ErrorInfoBarDelegate(error)))); } diff --git a/chrome/browser/ui/hung_plugin_tab_helper.cc b/chrome/browser/ui/hung_plugin_tab_helper.cc index 1b6d092..bb9a21c 100644 --- a/chrome/browser/ui/hung_plugin_tab_helper.cc +++ b/chrome/browser/ui/hung_plugin_tab_helper.cc @@ -162,7 +162,7 @@ infobars::InfoBar* HungPluginInfoBarDelegate::Create( HungPluginTabHelper* helper, int plugin_child_id, const base::string16& plugin_name) { - return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new HungPluginInfoBarDelegate( helper, plugin_child_id, plugin_name)))); } diff --git a/chrome/browser/ui/startup/autolaunch_prompt_win.cc b/chrome/browser/ui/startup/autolaunch_prompt_win.cc index dc73b29..01e0401 100644 --- a/chrome/browser/ui/startup/autolaunch_prompt_win.cc +++ b/chrome/browser/ui/startup/autolaunch_prompt_win.cc @@ -70,8 +70,8 @@ class AutolaunchInfoBarDelegate : public ConfirmInfoBarDelegate { // static void AutolaunchInfoBarDelegate::Create(InfoBarService* infobar_service, Profile* profile) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new AutolaunchInfoBarDelegate(profile)))); } diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc index 139ab9f..fcd0798 100644 --- a/chrome/browser/ui/startup/default_browser_prompt.cc +++ b/chrome/browser/ui/startup/default_browser_prompt.cc @@ -104,7 +104,7 @@ class DefaultBrowserInfoBarDelegate : public ConfirmInfoBarDelegate { void DefaultBrowserInfoBarDelegate::Create(InfoBarService* infobar_service, PrefService* prefs, bool interactive_flow_required) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new DefaultBrowserInfoBarDelegate( prefs, interactive_flow_required)))); } diff --git a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc index edea11a..58bc710 100644 --- a/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc +++ b/chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc @@ -18,7 +18,7 @@ void GoogleApiKeysInfoBarDelegate::Create(InfoBarService* infobar_service) { if (google_apis::HasKeysConfigured()) return; - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new GoogleApiKeysInfoBarDelegate()))); } diff --git a/chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc b/chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc index d10f849..5b762fc 100644 --- a/chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc +++ b/chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc @@ -23,7 +23,7 @@ void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) { !ObsoleteSystemMac::Has32BitOnlyCPU()) { return; } - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate()))); #else // No other platforms currently show this infobar. diff --git a/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc b/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc index 4f074a8..b68ba8e 100644 --- a/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc +++ b/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc @@ -33,8 +33,10 @@ void SessionCrashedInfoBarDelegate::Create(Browser* browser) { if (profile->IsOffTheRecord() || !web_contents) return; - InfoBarService::FromWebContents(web_contents)->AddInfoBar( - ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( + InfoBarService* infobar_service = + InfoBarService::FromWebContents(web_contents); + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new SessionCrashedInfoBarDelegate(profile)))); } diff --git a/chrome/browser/ui/views/infobars/confirm_infobar.cc b/chrome/browser/ui/views/infobars/confirm_infobar.cc index 6e78968..b177035 100644 --- a/chrome/browser/ui/views/infobars/confirm_infobar.cc +++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/infobars/confirm_infobar.h" #include "base/logging.h" +#include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/ui/views/elevation_icon_setter.h" #include "components/infobars/core/confirm_infobar_delegate.h" #include "ui/base/window_open_disposition.h" @@ -12,11 +13,9 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" +// InfoBarService ------------------------------------------------------------- -// ConfirmInfoBarDelegate ----------------------------------------------------- - -// static -scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar( +scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate> delegate) { return make_scoped_ptr(new ConfirmInfoBar(delegate.Pass())); } diff --git a/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc index 8afa928..76c60a4 100644 --- a/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc +++ b/chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc @@ -16,8 +16,8 @@ // static void WebsiteSettingsInfoBarDelegate::Create(InfoBarService* infobar_service) { - infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( - scoped_ptr<ConfirmInfoBarDelegate>( + infobar_service->AddInfoBar( + infobar_service->CreateConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( new WebsiteSettingsInfoBarDelegate()))); } |