Skip to content

Commit

Permalink
Remove dependency of infobars component on the embedder
Browse files Browse the repository at this point in the history
Add a virtual method InfoBarManager::CreateConfirmInfoBar that allow the
embedder to use UI specific implementation of ConfirmInfoBar. Port all
client code to use this virtual method instead of the static method
ConfirmInfoBarDelegate::CreateInfoBar.

Implements the InfoBarService::CreateConfirmInfoBar method for the
different UI (views, android, cocoa) and for TestInfoBarManager.

BUG=386171
TBR=jam@chromium.org
TBR=jochen@chromium.org

Review URL: https://codereview.chromium.org/812823002

Cr-Commit-Position: refs/heads/master@{#309437}
  • Loading branch information
sdefresne authored and Commit bot committed Dec 22, 2014
1 parent a84772b commit 316da45
Show file tree
Hide file tree
Showing 59 changed files with 121 additions and 172 deletions.
4 changes: 0 additions & 4 deletions athena/main/athena_main.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
'../resources/athena_resources.gyp:athena_resources',
'../../components/components.gyp:component_metrics_proto',
'../../components/components.gyp:history_core_browser',
# infobars_test_support is required to declare some symbols used in the
# search_engines and its dependencies. See crbug.com/386171
# TODO(mukai): declare those symbols for Athena.
'../../components/components.gyp:infobars_test_support',
'../../components/components.gyp:omnibox',
'../../components/components.gyp:pdf_renderer',
'../../components/components.gyp:search_engines',
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autofill/autofill_cc_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_quota_permission_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/devtools/devtools_ui_bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/extensions/api/debugger/debugger_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
Expand Down
8 changes: 4 additions & 4 deletions chrome/browser/extensions/theme_installed_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions chrome/browser/geolocation/geolocation_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/gpu/three_d_api_observer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}

Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/infobars/infobar_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 6 additions & 0 deletions chrome/browser/infobars/infobar_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/infobars/simple_alert_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/media/media_stream_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/media/midi_permission_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/nacl_host/nacl_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/pepper_broker_infobar_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
24 changes: 13 additions & 11 deletions chrome/browser/plugins/plugin_infobar_delegates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)))));
Expand Down Expand Up @@ -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)))));
}

Expand All @@ -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))));
Expand Down Expand Up @@ -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))));
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/plugins/plugin_observer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ssl/ssl_add_certificate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 316da45

Please sign in to comment.