summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-10 13:53:26 +0000
committerdroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-10 13:53:26 +0000
commitb44f1d387d68ab967d19c39c621d11526928f576 (patch)
tree059b0d4a2f7d1c94ce99e9d24dd9cf45b8ef35d6 /chrome
parent78ecee494f7c61af7923b3f61126b088b5592e2b (diff)
downloadchromium_src-b44f1d387d68ab967d19c39c621d11526928f576.zip
chromium_src-b44f1d387d68ab967d19c39c621d11526928f576.tar.gz
chromium_src-b44f1d387d68ab967d19c39c621d11526928f576.tar.bz2
InfoBarService inherits from InfoBarManager
This allows to change the implementation of InfoBarDelegate::web_contents() such that it no longer calls InfoBarManager::web_contents() (which will be removed), but InfoBarService::web_contents() instead. BUG=354379 TBR=jochen Review URL: https://codereview.chromium.org/228293004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262976 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/accessibility/accessibility_extension_api.cc8
-rw-r--r--chrome/browser/android/tab_android.cc6
-rw-r--r--chrome/browser/autofill/autofill_browsertest.cc14
-rw-r--r--chrome/browser/autofill/autofill_interactive_uitest.cc16
-rw-r--r--chrome/browser/content_settings/permission_queue_controller.cc7
-rw-r--r--chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc6
-rw-r--r--chrome/browser/download/download_browsertest.cc10
-rw-r--r--chrome/browser/extensions/api/debugger/debugger_api.cc3
-rw-r--r--chrome/browser/extensions/extension_install_ui_browsertest.cc11
-rw-r--r--chrome/browser/extensions/theme_installed_infobar_delegate.cc6
-rw-r--r--chrome/browser/extensions/webstore_startup_installer_browsertest.cc6
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc152
-rw-r--r--chrome/browser/geolocation/geolocation_browsertest.cc12
-rw-r--r--chrome/browser/infobars/infobar_delegate.cc3
-rw-r--r--chrome/browser/infobars/infobar_delegate.h2
-rw-r--r--chrome/browser/infobars/infobar_manager.cc35
-rw-r--r--chrome/browser/infobars/infobar_manager.h31
-rw-r--r--chrome/browser/infobars/infobar_service.cc106
-rw-r--r--chrome/browser/infobars/infobar_service.h37
-rw-r--r--chrome/browser/infobars/infobars_browsertest.cc13
-rw-r--r--chrome/browser/infobars/insecure_content_infobar_delegate.cc6
-rw-r--r--chrome/browser/managed_mode/managed_mode_interstitial.cc8
-rw-r--r--chrome/browser/managed_mode/managed_mode_navigation_observer.cc5
-rw-r--r--chrome/browser/media/chrome_media_stream_infobar_browsertest.cc7
-rw-r--r--chrome/browser/media/media_stream_infobar_delegate.cc6
-rw-r--r--chrome/browser/media/webrtc_browsertest_base.cc7
-rw-r--r--chrome/browser/notifications/notification_browsertest.cc25
-rw-r--r--chrome/browser/password_manager/password_manager_browsertest.cc8
-rw-r--r--chrome/browser/policy/policy_browsertest.cc23
-rw-r--r--chrome/browser/translate/translate_browsertest.cc14
-rw-r--r--chrome/browser/translate/translate_infobar_delegate.cc6
-rw-r--r--chrome/browser/translate/translate_manager_render_view_host_unittest.cc27
-rw-r--r--chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc13
-rw-r--r--chrome/browser/ui/android/infobars/infobar_container_android.cc7
-rw-r--r--chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm3
-rw-r--r--chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm7
-rw-r--r--chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm3
-rw-r--r--chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc7
-rw-r--r--chrome/browser/ui/gtk/browser_window_gtk.cc5
-rw-r--r--chrome/browser/ui/hung_plugin_tab_helper.cc9
-rw-r--r--chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc13
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_browsertest.cc7
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc5
-rw-r--r--chrome/browser/ui/website_settings/website_settings_unittest.cc12
-rw-r--r--chrome/test/gpu/webgl_infobar_browsertest.cc10
-rw-r--r--chrome/test/ppapi/ppapi_test.cc8
47 files changed, 331 insertions, 406 deletions
diff --git a/chrome/browser/accessibility/accessibility_extension_api.cc b/chrome/browser/accessibility/accessibility_extension_api.cc
index 1a5b3d4..e7fd6c0 100644
--- a/chrome/browser/accessibility/accessibility_extension_api.cc
+++ b/chrome/browser/accessibility/accessibility_extension_api.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/api/accessibility_private.h"
@@ -275,12 +274,11 @@ bool AccessibilityPrivateGetAlertsForTabFunction::RunImpl() {
base::ListValue* alerts_value = new base::ListValue;
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(contents)->infobar_manager();
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
+ InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
+ for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
// TODO(hashimoto): Make other kind of alerts available. crosbug.com/24281
ConfirmInfoBarDelegate* confirm_infobar_delegate =
- infobar_manager->infobar_at(i)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service->infobar_at(i)->delegate()->AsConfirmInfoBarDelegate();
if (confirm_infobar_delegate) {
base::DictionaryValue* alert_value = new base::DictionaryValue;
const base::string16 message_text =
diff --git a/chrome/browser/android/tab_android.cc b/chrome/browser/android/tab_android.cc
index fdd4766..e797101 100644
--- a/chrome/browser/android/tab_android.cc
+++ b/chrome/browser/android/tab_android.cc
@@ -231,9 +231,9 @@ void TabAndroid::SwapTabContents(content::WebContents* old_contents,
Java_Tab_getNativeInfoBarContainer(
env,
weak_java_tab_.get(env).obj()));
- InfoBarManager* new_infobar_manager = new_contents ?
- InfoBarService::InfoBarManagerFromWebContents(new_contents) : NULL;
- infobar_container->ChangeInfoBarManager(new_infobar_manager);
+ InfoBarService* new_infobar_service =
+ new_contents ? InfoBarService::FromWebContents(new_contents) : NULL;
+ infobar_container->ChangeInfoBarManager(new_infobar_service);
Java_Tab_swapWebContents(
env,
diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc
index 0eb543e..53cac37 100644
--- a/chrome/browser/autofill/autofill_browsertest.cc
+++ b/chrome/browser/autofill/autofill_browsertest.cc
@@ -19,7 +19,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -71,10 +70,8 @@ class WindowedPersonalDataManagerObserver
}
virtual ~WindowedPersonalDataManagerObserver() {
- if (infobar_service_ &&
- (infobar_service_->infobar_manager()->infobar_count() > 0)) {
- InfoBarManager* infobar_manager = infobar_service_->infobar_manager();
- infobar_manager->RemoveInfoBar(infobar_manager->infobar_at(0));
+ if (infobar_service_ && (infobar_service_->infobar_count() > 0)) {
+ infobar_service_->RemoveInfoBar(infobar_service_->infobar_at(0));
}
}
@@ -107,9 +104,8 @@ class WindowedPersonalDataManagerObserver
EXPECT_EQ(chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, type);
infobar_service_ = InfoBarService::FromWebContents(
browser_->tab_strip_model()->GetActiveWebContents());
- InfoBarManager* infobar_manager = infobar_service_->infobar_manager();
ConfirmInfoBarDelegate* infobar_delegate =
- infobar_manager->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service_->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate);
infobar_delegate->Accept();
}
@@ -495,7 +491,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, InvalidCreditCardNumberIsNotAggregated) {
SubmitCreditCard("Bob Smith", card.c_str(), "12", "2014");
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetActiveWebContents());
- ASSERT_EQ(0u, infobar_service->infobar_manager()->infobar_count());
+ ASSERT_EQ(0u, infobar_service->infobar_count());
}
// Test whitespaces and separator chars are stripped for valid CC numbers.
@@ -681,7 +677,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, CCInfoNotStoredWhenAutocompleteOff) {
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetActiveWebContents());
- ASSERT_EQ(0u, infobar_service->infobar_manager()->infobar_count());
+ ASSERT_EQ(0u, infobar_service->infobar_count());
}
// Test profile not aggregated if email found in non-email field.
diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc
index f49ece2..2886fb8 100644
--- a/chrome/browser/autofill/autofill_interactive_uitest.cc
+++ b/chrome/browser/autofill/autofill_interactive_uitest.cc
@@ -19,7 +19,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/translate/translate_infobar_delegate.h"
@@ -147,9 +146,8 @@ class WindowedPersonalDataManagerObserver
virtual ~WindowedPersonalDataManagerObserver() {
if (infobar_service_) {
- InfoBarManager* infobar_manager = infobar_service_->infobar_manager();
- while (infobar_manager->infobar_count() > 0) {
- infobar_manager->RemoveInfoBar(infobar_manager->infobar_at(0));
+ while (infobar_service_->infobar_count() > 0) {
+ infobar_service_->RemoveInfoBar(infobar_service_->infobar_at(0));
}
}
}
@@ -173,8 +171,8 @@ class WindowedPersonalDataManagerObserver
const content::NotificationDetails& details) OVERRIDE {
infobar_service_ = InfoBarService::FromWebContents(
browser_->tab_strip_model()->GetActiveWebContents());
- infobar_service_->infobar_manager()->infobar_at(0)->delegate()
- ->AsConfirmInfoBarDelegate()->Accept();
+ infobar_service_->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate()->
+ Accept();
}
void Wait() {
@@ -980,10 +978,10 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, AutofillAfterTranslate) {
// Wait for the translation bar to appear and get it.
infobar_observer.Wait();
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(GetWebContents())->infobar_manager();
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(GetWebContents());
TranslateInfoBarDelegate* delegate =
- infobar_manager->infobar_at(0)->delegate()->AsTranslateInfoBarDelegate();
+ infobar_service->infobar_at(0)->delegate()->AsTranslateInfoBarDelegate();
ASSERT_TRUE(delegate);
EXPECT_EQ(translate::TRANSLATE_STEP_BEFORE_TRANSLATE,
delegate->translate_step());
diff --git a/chrome/browser/content_settings/permission_queue_controller.cc b/chrome/browser/content_settings/permission_queue_controller.cc
index 97828d9..3b30691 100644
--- a/chrome/browser/content_settings/permission_queue_controller.cc
+++ b/chrome/browser/content_settings/permission_queue_controller.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/geolocation/geolocation_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/media/midi_permission_infobar_delegate.h"
#include "chrome/browser/profiles/profile.h"
@@ -175,7 +174,7 @@ void PermissionQueueController::CancelInfoBarRequest(
i != pending_infobar_requests_.end(); ++i) {
if (i->id().Equals(id)) {
if (i->has_infobar())
- GetInfoBarService(id)->infobar_manager()->RemoveInfoBar(i->infobar());
+ GetInfoBarService(id)->RemoveInfoBar(i->infobar());
else
pending_infobar_requests_.erase(i);
return;
@@ -209,7 +208,7 @@ void PermissionQueueController::CancelInfoBarRequests(int group_id) {
for (PendingInfobarRequests::iterator i = infobar_requests_to_cancel.begin();
i != infobar_requests_to_cancel.end();
++i) {
- GetInfoBarService(i->id())->infobar_manager()->RemoveInfoBar(i->infobar());
+ GetInfoBarService(i->id())->RemoveInfoBar(i->infobar());
}
}
@@ -255,7 +254,7 @@ void PermissionQueueController::OnPermissionSet(
// Remove all infobars for the same |requesting_frame| and |embedder|.
for (PendingInfobarRequests::iterator i = infobars_to_remove.begin();
i != infobars_to_remove.end(); ++i)
- GetInfoBarService(i->id())->infobar_manager()->RemoveInfoBar(i->infobar());
+ GetInfoBarService(i->id())->RemoveInfoBar(i->infobar());
// Send out the permission notifications.
for (PendingInfobarRequests::iterator i = requests_to_notify.begin();
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 a23ad22..6160b6e 100644
--- a/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
+++ b/chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc
@@ -7,7 +7,6 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/user_metrics.h"
@@ -27,9 +26,8 @@ void RegisterProtocolHandlerInfoBarDelegate::Create(
scoped_ptr<ConfirmInfoBarDelegate>(
new RegisterProtocolHandlerInfoBarDelegate(registry, handler))));
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
- InfoBar* existing_infobar = infobar_manager->infobar_at(i);
+ for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBar* existing_infobar = infobar_service->infobar_at(i);
RegisterProtocolHandlerInfoBarDelegate* existing_delegate =
existing_infobar->delegate()->
AsRegisterProtocolHandlerInfoBarDelegate();
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index c4de117..8eb596f 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -44,7 +44,6 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/net/url_request_mock_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -2793,12 +2792,11 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, TestMultipleDownloadsInfobar) {
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetActiveWebContents());
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
// Verify that there is only one infobar.
- ASSERT_EQ(1u, infobar_manager->infobar_count());
+ ASSERT_EQ(1u, infobar_service->infobar_count());
// Get the infobar at index 0.
- InfoBar* infobar = infobar_manager->infobar_at(0);
+ InfoBar* infobar = infobar_service->infobar_at(0);
ConfirmInfoBarDelegate* confirm_infobar =
infobar->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(confirm_infobar != NULL);
@@ -2809,9 +2807,9 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, TestMultipleDownloadsInfobar) {
// Click on the "Allow" button to allow multiple downloads.
if (confirm_infobar->Accept())
- infobar_manager->RemoveInfoBar(infobar);
+ infobar_service->RemoveInfoBar(infobar);
// Verify that there are no more infobars.
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
// Waits for the download to complete.
downloads_observer->WaitForFinished();
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc
index b0afffb..839f999 100644
--- a/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -25,7 +25,6 @@
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
@@ -342,7 +341,7 @@ ExtensionDevToolsClientHost::~ExtensionDevToolsClientHost() {
infobar_->delegate())->set_client_host(NULL);
InfoBarService* infobar_service = InfoBarService::FromWebContents(
WebContents::FromRenderViewHost(agent_host_->GetRenderViewHost()));
- infobar_service->infobar_manager()->RemoveInfoBar(infobar_);
+ infobar_service->RemoveInfoBar(infobar_);
}
AttachedClientHosts::GetInstance()->Remove(this);
}
diff --git a/chrome/browser/extensions/extension_install_ui_browsertest.cc b/chrome/browser/extensions/extension_install_ui_browsertest.cc
index 7f3f9bb..ca70ad8 100644
--- a/chrome/browser/extensions/extension_install_ui_browsertest.cc
+++ b/chrome/browser/extensions/extension_install_ui_browsertest.cc
@@ -10,7 +10,6 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_service.h"
@@ -41,14 +40,14 @@ class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest {
WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(web_contents);
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(web_contents)->infobar_manager();
- ASSERT_EQ(1U, infobar_manager->infobar_count());
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ ASSERT_EQ(1U, infobar_service->infobar_count());
ConfirmInfoBarDelegate* delegate =
- infobar_manager->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(delegate);
delegate->Cancel();
- ASSERT_EQ(0U, infobar_manager->infobar_count());
+ ASSERT_EQ(0U, infobar_service->infobar_count());
}
// Install the given theme from the data dir and verify expected name.
diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc
index 68ef436..986250e 100644
--- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc
+++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc
@@ -10,7 +10,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_service.h"
@@ -48,7 +47,6 @@ void ThemeInstalledInfoBarDelegate::Create(
return;
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
ThemeService* theme_service = ThemeServiceFactory::GetForProfile(profile);
scoped_ptr<InfoBar> new_infobar(ConfirmInfoBarDelegate::CreateInfoBar(
scoped_ptr<ConfirmInfoBarDelegate>(new ThemeInstalledInfoBarDelegate(
@@ -57,8 +55,8 @@ void ThemeInstalledInfoBarDelegate::Create(
// If there's a previous theme infobar, just replace that instead of adding a
// new one.
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
- InfoBar* old_infobar = infobar_manager->infobar_at(i);
+ for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBar* old_infobar = infobar_service->infobar_at(i);
ThemeInstalledInfoBarDelegate* theme_infobar =
old_infobar->delegate()->AsThemePreviewInfobarDelegate();
if (theme_infobar) {
diff --git a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc
index 4f11ef9..3a25c26 100644
--- a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc
@@ -8,7 +8,6 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/startup_helper.h"
#include "chrome/browser/extensions/webstore_installer_test.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/managed_mode/managed_user_service.h"
#include "chrome/browser/managed_mode/managed_user_service_factory.h"
@@ -201,9 +200,8 @@ IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerManagedUsersTest,
// No error infobar should show up.
WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(contents)->infobar_manager();
- EXPECT_EQ(infobar_manager->infobar_count(), 0u);
+ InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
+ EXPECT_EQ(0u, infobar_service->infobar_count());
}
// The unpack failure test needs to use a different install .crx, which is
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
index 10e3439..903702b 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
@@ -20,7 +20,7 @@
#include "chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
+#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
@@ -105,11 +105,11 @@ class GeolocationPermissionContextTests
PermissionRequestID RequestID(int bridge_id);
PermissionRequestID RequestIDForTab(int tab, int bridge_id);
- InfoBarManager* infobar_manager() {
- return InfoBarService::FromWebContents(web_contents())->infobar_manager();
+ InfoBarService* infobar_service() {
+ return InfoBarService::FromWebContents(web_contents());
}
- InfoBarManager* infobar_manager_for_tab(int tab) {
- return InfoBarService::FromWebContents(extra_tabs_[tab])->infobar_manager();
+ InfoBarService* infobar_service_for_tab(int tab) {
+ return InfoBarService::FromWebContents(extra_tabs_[tab]);
}
void RequestGeolocationPermission(const PermissionRequestID& id,
@@ -262,15 +262,15 @@ void GeolocationPermissionContextTests::TearDown() {
TEST_F(GeolocationPermissionContextTests, SinglePermission) {
GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
- InfoBar* infobar = infobar_manager()->infobar_at(0);
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
+ InfoBar* infobar = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate =
infobar->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate);
infobar_delegate->Cancel();
- infobar_manager()->RemoveInfoBar(infobar);
+ infobar_service()->RemoveInfoBar(infobar);
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar));
}
@@ -280,22 +280,22 @@ TEST_F(GeolocationPermissionContextTests, GeolocationEnabledDisabled) {
GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
MockGoogleLocationSettingsHelper::SetLocationStatus(true, true);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- EXPECT_EQ(1U, infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service()->infobar_count());
ConfirmInfoBarDelegate* infobar_delegate_0 =
- infobar_manager()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_0);
base::string16 text_0 = infobar_delegate_0->GetButtonLabel(
ConfirmInfoBarDelegate::BUTTON_OK);
NavigateAndCommit(requesting_frame);
MockGoogleLocationSettingsHelper::SetLocationStatus(true, false);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- EXPECT_EQ(1U, infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service()->infobar_count());
ConfirmInfoBarDelegate* infobar_delegate_1 =
- infobar_manager()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_1);
base::string16 text_1 = infobar_delegate_1->GetButtonLabel(
ConfirmInfoBarDelegate::BUTTON_OK);
@@ -303,20 +303,20 @@ TEST_F(GeolocationPermissionContextTests, GeolocationEnabledDisabled) {
NavigateAndCommit(requesting_frame);
MockGoogleLocationSettingsHelper::SetLocationStatus(false, false);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
}
TEST_F(GeolocationPermissionContextTests, MasterEnabledGoogleAppsEnabled) {
GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
MockGoogleLocationSettingsHelper::SetLocationStatus(true, true);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- EXPECT_EQ(1U, infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service()->infobar_count());
ConfirmInfoBarDelegate* infobar_delegate =
- infobar_manager()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate);
infobar_delegate->Accept();
CheckTabContentsState(requesting_frame, CONTENT_SETTING_ALLOW);
@@ -327,11 +327,11 @@ TEST_F(GeolocationPermissionContextTests, MasterEnabledGoogleAppsDisabled) {
GURL requesting_frame("http://www.example.com/geolocation");
NavigateAndCommit(requesting_frame);
MockGoogleLocationSettingsHelper::SetLocationStatus(true, false);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- EXPECT_EQ(1U, infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service()->infobar_count());
ConfirmInfoBarDelegate* infobar_delegate =
- infobar_manager()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service()->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate);
infobar_delegate->Accept();
EXPECT_TRUE(
@@ -352,13 +352,13 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
NavigateAndCommit(requesting_frame_0);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Request permission for two frames.
RequestGeolocationPermission(RequestID(0), requesting_frame_0);
RequestGeolocationPermission(RequestID(1), requesting_frame_1);
// Ensure only one infobar is created.
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
- InfoBar* infobar_0 = infobar_manager()->infobar_at(0);
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
+ InfoBar* infobar_0 = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_0 =
infobar_0->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_0);
@@ -369,14 +369,14 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
CheckTabContentsState(requesting_frame_0, CONTENT_SETTING_ALLOW);
CheckPermissionMessageSent(0, true);
- infobar_manager()->RemoveInfoBar(infobar_0);
+ infobar_service()->RemoveInfoBar(infobar_0);
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_0));
closed_infobar_tracker_.Clear();
// Now we should have a new infobar for the second frame.
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
- InfoBar* infobar_1 = infobar_manager()->infobar_at(0);
+ InfoBar* infobar_1 = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_1 =
infobar_1->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_1);
@@ -387,10 +387,10 @@ TEST_F(GeolocationPermissionContextTests, QueuedPermission) {
infobar_delegate_1->Cancel();
CheckTabContentsState(requesting_frame_1, CONTENT_SETTING_BLOCK);
CheckPermissionMessageSent(1, false);
- infobar_manager()->RemoveInfoBar(infobar_1);
+ infobar_service()->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_1));
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Ensure the persisted permissions are ok.
EXPECT_EQ(CONTENT_SETTING_ALLOW,
profile()->GetHostContentSettingsMap()->GetContentSetting(
@@ -409,10 +409,10 @@ TEST_F(GeolocationPermissionContextTests, HashIsIgnored) {
// Navigate to the first url and check permission is requested.
NavigateAndCommit(url_a);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), url_a);
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
- InfoBar* infobar = infobar_manager()->infobar_at(0);
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
+ InfoBar* infobar = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate =
infobar->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate);
@@ -427,7 +427,7 @@ TEST_F(GeolocationPermissionContextTests, HashIsIgnored) {
CheckPermissionMessageSent(0, true);
// Cleanup.
- infobar_manager()->RemoveInfoBar(infobar);
+ infobar_service()->RemoveInfoBar(infobar);
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar));
}
@@ -435,10 +435,10 @@ TEST_F(GeolocationPermissionContextTests, HashIsIgnored) {
TEST_F(GeolocationPermissionContextTests, PermissionForFileScheme) {
GURL requesting_frame("file://example/geolocation.html");
NavigateAndCommit(requesting_frame);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- EXPECT_EQ(1U, infobar_manager()->infobar_count());
- InfoBar* infobar = infobar_manager()->infobar_at(0);
+ EXPECT_EQ(1U, infobar_service()->infobar_count());
+ InfoBar* infobar = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate =
infobar->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate);
@@ -446,7 +446,7 @@ TEST_F(GeolocationPermissionContextTests, PermissionForFileScheme) {
infobar_delegate->Accept();
CheckTabContentsState(requesting_frame, CONTENT_SETTING_ALLOW);
CheckPermissionMessageSent(0, true);
- infobar_manager()->RemoveInfoBar(infobar);
+ infobar_service()->RemoveInfoBar(infobar);
// Make sure the setting is not stored.
EXPECT_EQ(CONTENT_SETTING_ASK,
@@ -471,13 +471,13 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) {
CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
NavigateAndCommit(requesting_frame_0);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Request permission for two frames.
RequestGeolocationPermission(RequestID(0), requesting_frame_0);
RequestGeolocationPermission(RequestID(1), requesting_frame_1);
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
- InfoBar* infobar_0 = infobar_manager()->infobar_at(0);
+ InfoBar* infobar_0 = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_0 =
infobar_0->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_0);
@@ -489,9 +489,9 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) {
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_0));
closed_infobar_tracker_.Clear();
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
- InfoBar* infobar_1 = infobar_manager()->infobar_at(0);
+ InfoBar* infobar_1 = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_1 =
infobar_1->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_1);
@@ -502,10 +502,10 @@ TEST_F(GeolocationPermissionContextTests, CancelGeolocationPermissionRequest) {
infobar_delegate_1->Accept();
CheckTabContentsState(requesting_frame_1, CONTENT_SETTING_ALLOW);
CheckPermissionMessageSent(1, true);
- infobar_manager()->RemoveInfoBar(infobar_1);
+ infobar_service()->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_1));
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Ensure the persisted permissions are ok.
EXPECT_EQ(CONTENT_SETTING_ASK,
profile()->GetHostContentSettingsMap()->GetContentSetting(
@@ -522,9 +522,9 @@ TEST_F(GeolocationPermissionContextTests, InvalidURL) {
GURL invalid_embedder("about:blank");
GURL requesting_frame;
NavigateAndCommit(invalid_embedder);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), requesting_frame);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
CheckPermissionMessageSent(0, false);
}
@@ -535,42 +535,42 @@ TEST_F(GeolocationPermissionContextTests, SameOriginMultipleTabs) {
AddNewTab(url_b);
AddNewTab(url_a);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), url_a);
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestIDForTab(0, 0), url_b);
- EXPECT_EQ(1U, infobar_manager_for_tab(0)->infobar_count());
+ EXPECT_EQ(1U, infobar_service_for_tab(0)->infobar_count());
RequestGeolocationPermission(RequestIDForTab(1, 0), url_a);
- ASSERT_EQ(1U, infobar_manager_for_tab(1)->infobar_count());
+ ASSERT_EQ(1U, infobar_service_for_tab(1)->infobar_count());
- InfoBar* removed_infobar = infobar_manager_for_tab(1)->infobar_at(0);
+ InfoBar* removed_infobar = infobar_service_for_tab(1)->infobar_at(0);
// Accept the first tab.
- InfoBar* infobar_0 = infobar_manager()->infobar_at(0);
+ InfoBar* infobar_0 = infobar_service()->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_0 =
infobar_0->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_0);
infobar_delegate_0->Accept();
CheckPermissionMessageSent(0, true);
- infobar_manager()->RemoveInfoBar(infobar_0);
+ infobar_service()->RemoveInfoBar(infobar_0);
EXPECT_EQ(2U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_0));
// Now the infobar for the tab with the same origin should have gone.
- EXPECT_EQ(0U, infobar_manager_for_tab(1)->infobar_count());
+ EXPECT_EQ(0U, infobar_service_for_tab(1)->infobar_count());
CheckPermissionMessageSentForTab(1, 0, true);
EXPECT_TRUE(closed_infobar_tracker_.Contains(removed_infobar));
closed_infobar_tracker_.Clear();
// But the other tab should still have the info bar...
- ASSERT_EQ(1U, infobar_manager_for_tab(0)->infobar_count());
- InfoBar* infobar_1 = infobar_manager_for_tab(0)->infobar_at(0);
+ ASSERT_EQ(1U, infobar_service_for_tab(0)->infobar_count());
+ InfoBar* infobar_1 = infobar_service_for_tab(0)->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_1 =
infobar_1->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_1);
infobar_delegate_1->Cancel();
- infobar_manager_for_tab(0)->RemoveInfoBar(infobar_1);
+ infobar_service_for_tab(0)->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_1));
}
@@ -581,45 +581,45 @@ TEST_F(GeolocationPermissionContextTests, QueuedOriginMultipleTabs) {
NavigateAndCommit(url_a);
AddNewTab(url_a);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestID(0), url_a);
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
RequestGeolocationPermission(RequestIDForTab(0, 0), url_a);
- EXPECT_EQ(1U, infobar_manager_for_tab(0)->infobar_count());
+ EXPECT_EQ(1U, infobar_service_for_tab(0)->infobar_count());
RequestGeolocationPermission(RequestIDForTab(0, 1), url_b);
- ASSERT_EQ(1U, infobar_manager_for_tab(0)->infobar_count());
+ ASSERT_EQ(1U, infobar_service_for_tab(0)->infobar_count());
- InfoBar* removed_infobar = infobar_manager()->infobar_at(0);
+ InfoBar* removed_infobar = infobar_service()->infobar_at(0);
// Accept the second tab.
- InfoBar* infobar_0 = infobar_manager_for_tab(0)->infobar_at(0);
+ InfoBar* infobar_0 = infobar_service_for_tab(0)->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_0 =
infobar_0->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_0);
infobar_delegate_0->Accept();
CheckPermissionMessageSentForTab(0, 0, true);
- infobar_manager_for_tab(0)->RemoveInfoBar(infobar_0);
+ infobar_service_for_tab(0)->RemoveInfoBar(infobar_0);
EXPECT_EQ(2U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_0));
// Now the infobar for the tab with the same origin should have gone.
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
CheckPermissionMessageSent(0, true);
EXPECT_TRUE(closed_infobar_tracker_.Contains(removed_infobar));
closed_infobar_tracker_.Clear();
// And we should have the queued infobar displayed now.
- ASSERT_EQ(1U, infobar_manager_for_tab(0)->infobar_count());
+ ASSERT_EQ(1U, infobar_service_for_tab(0)->infobar_count());
// Accept the second infobar.
- InfoBar* infobar_1 = infobar_manager_for_tab(0)->infobar_at(0);
+ InfoBar* infobar_1 = infobar_service_for_tab(0)->infobar_at(0);
ConfirmInfoBarDelegate* infobar_delegate_1 =
infobar_1->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar_delegate_1);
infobar_delegate_1->Accept();
CheckPermissionMessageSentForTab(0, 1, true);
- infobar_manager_for_tab(0)->RemoveInfoBar(infobar_1);
+ infobar_service_for_tab(0)->RemoveInfoBar(infobar_1);
EXPECT_EQ(1U, closed_infobar_tracker_.size());
EXPECT_TRUE(closed_infobar_tracker_.Contains(infobar_1));
}
@@ -645,13 +645,13 @@ TEST_F(GeolocationPermissionContextTests, MAYBE_TabDestroyed) {
CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()));
NavigateAndCommit(requesting_frame_0);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Request permission for two frames.
RequestGeolocationPermission(RequestID(0), requesting_frame_0);
RequestGeolocationPermission(RequestID(1), requesting_frame_1);
// Ensure only one infobar is created.
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
- InfoBar* infobar = infobar_manager()->infobar_at(0);
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
+ InfoBar* infobar = infobar_service()->infobar_at(0);
// Delete the tab contents.
DeleteContents();
@@ -667,16 +667,16 @@ TEST_F(GeolocationPermissionContextTests, InfoBarUsesCommittedEntry) {
GURL requesting_frame_1("http://www.example-2.com/geolocation");
NavigateAndCommit(requesting_frame_0);
NavigateAndCommit(requesting_frame_1);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Go back: navigate to a pending entry before requesting geolocation
// permission.
web_contents()->GetController().GoBack();
// Request permission for the committed frame (not the pending one).
RequestGeolocationPermission(RequestID(0), requesting_frame_1);
// Ensure the infobar is created.
- ASSERT_EQ(1U, infobar_manager()->infobar_count());
+ ASSERT_EQ(1U, infobar_service()->infobar_count());
InfoBarDelegate* infobar_delegate =
- infobar_manager()->infobar_at(0)->delegate();
+ infobar_service()->infobar_at(0)->delegate();
ASSERT_TRUE(infobar_delegate);
// Ensure the infobar wouldn't expire for a navigation to the committed entry.
content::LoadCommittedDetails details;
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index 6feb267..dc1b936 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -421,9 +420,9 @@ void GeolocationBrowserTest::SetInfoBarResponse(const GURL& requesting_url,
observer.Wait();
}
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(web_contents)->infobar_manager();
- infobar_manager->RemoveInfoBar(infobar_);
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ infobar_service->RemoveInfoBar(infobar_);
LOG(WARNING) << "infobar response set";
infobar_ = NULL;
EXPECT_GT(usages_state.state_map().size(), state_map_size);
@@ -671,11 +670,10 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, CancelPermissionForFrame) {
InfoBarService* infobar_service = InfoBarService::FromWebContents(
current_browser()->tab_strip_model()->GetActiveWebContents());
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- size_t num_infobars_before_cancel = infobar_manager->infobar_count();
+ size_t num_infobars_before_cancel = infobar_service->infobar_count();
// Change the iframe, and ensure the infobar is gone.
IFrameLoader change_iframe_1(current_browser(), 1, current_url());
- size_t num_infobars_after_cancel = infobar_manager->infobar_count();
+ size_t num_infobars_after_cancel = infobar_service->infobar_count();
EXPECT_EQ(num_infobars_before_cancel, num_infobars_after_cancel + 1);
}
diff --git a/chrome/browser/infobars/infobar_delegate.cc b/chrome/browser/infobars/infobar_delegate.cc
index 5a69707..db645f2 100644
--- a/chrome/browser/infobars/infobar_delegate.cc
+++ b/chrome/browser/infobars/infobar_delegate.cc
@@ -108,8 +108,7 @@ gfx::Image InfoBarDelegate::GetIcon() const {
}
content::WebContents* InfoBarDelegate::web_contents() {
- return (infobar_ && infobar_->owner()) ?
- infobar_->owner()->web_contents() : NULL;
+ return InfoBarService::WebContentsFromInfoBar(infobar_);
}
InfoBarDelegate::InfoBarDelegate() : contents_unique_id_(0) {
diff --git a/chrome/browser/infobars/infobar_delegate.h b/chrome/browser/infobars/infobar_delegate.h
index caa9eff..48b4e27 100644
--- a/chrome/browser/infobars/infobar_delegate.h
+++ b/chrome/browser/infobars/infobar_delegate.h
@@ -127,6 +127,8 @@ class InfoBarDelegate {
// This trivial getter is defined out-of-line in order to avoid needing to
// #include infobar.h, which would lead to circular #includes.
+ // TODO(droger): Remove this function and have callers use
+ // InfoBarService::WebContentsFromInfoBar() instead.
content::WebContents* web_contents();
protected:
diff --git a/chrome/browser/infobars/infobar_manager.cc b/chrome/browser/infobars/infobar_manager.cc
index 4e3bcb6..ce2cb6c 100644
--- a/chrome/browser/infobars/infobar_manager.cc
+++ b/chrome/browser/infobars/infobar_manager.cc
@@ -25,7 +25,7 @@ InfoBar* InfoBarManager::AddInfoBar(scoped_ptr<InfoBar> infobar) {
infobars_.push_back(infobar_ptr);
infobar_ptr->SetOwner(this);
- FOR_EACH_OBSERVER(Observer, observer_list_, OnInfoBarAdded(infobar_ptr));
+ NotifyInfoBarAdded(infobar_ptr);
return infobar_ptr;
}
@@ -58,9 +58,7 @@ InfoBar* InfoBarManager::ReplaceInfoBar(InfoBar* old_infobar,
// to AddInfoBar() or similar, we don't dupe-check against this infobar.
infobars_.erase(++i);
- FOR_EACH_OBSERVER(Observer,
- observer_list_,
- OnInfoBarReplaced(old_infobar, new_infobar_ptr));
+ NotifyInfoBarReplaced(old_infobar, new_infobar_ptr);
old_infobar->CloseSoon();
return new_infobar_ptr;
@@ -74,15 +72,15 @@ void InfoBarManager::RemoveObserver(Observer* obs) {
observer_list_.RemoveObserver(obs);
}
-InfoBarManager::InfoBarManager(content::WebContents* web_contents)
- : infobars_enabled_(true),
- web_contents_(web_contents) {
- DCHECK(web_contents);
+InfoBarManager::InfoBarManager()
+ : infobars_enabled_(true) {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInfoBars))
infobars_enabled_ = false;
}
-InfoBarManager::~InfoBarManager() {
+InfoBarManager::~InfoBarManager() {}
+
+void InfoBarManager::ShutDown() {
// Destroy all remaining InfoBars. It's important to not animate here so that
// we guarantee that we'll delete all delegates before we do anything else.
RemoveAllInfoBars(false);
@@ -101,7 +99,21 @@ void InfoBarManager::OnNavigation(
}
}
-void InfoBarManager::OnWebContentsDestroyed() { web_contents_ = NULL; }
+void InfoBarManager::NotifyInfoBarAdded(InfoBar* infobar) {
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnInfoBarAdded(infobar));
+}
+
+void InfoBarManager::NotifyInfoBarRemoved(InfoBar* infobar, bool animate) {
+ FOR_EACH_OBSERVER(Observer, observer_list_,
+ OnInfoBarRemoved(infobar, animate));
+}
+
+void InfoBarManager::NotifyInfoBarReplaced(InfoBar* old_infobar,
+ InfoBar* new_infobar) {
+ FOR_EACH_OBSERVER(Observer,
+ observer_list_,
+ OnInfoBarReplaced(old_infobar, new_infobar));
+}
void InfoBarManager::RemoveInfoBarInternal(InfoBar* infobar, bool animate) {
DCHECK(infobar);
@@ -119,8 +131,7 @@ void InfoBarManager::RemoveInfoBarInternal(InfoBar* infobar, bool animate) {
// This notification must happen before the call to CloseSoon() below, since
// observers may want to access |infobar| and that call can delete it.
- FOR_EACH_OBSERVER(Observer, observer_list_,
- OnInfoBarRemoved(infobar, animate));
+ NotifyInfoBarRemoved(infobar, animate);
infobar->CloseSoon();
}
diff --git a/chrome/browser/infobars/infobar_manager.h b/chrome/browser/infobars/infobar_manager.h
index 7566010..14bb33e 100644
--- a/chrome/browser/infobars/infobar_manager.h
+++ b/chrome/browser/infobars/infobar_manager.h
@@ -31,8 +31,13 @@ class InfoBarManager {
virtual void OnManagerShuttingDown(InfoBarManager* manager) = 0;
};
- explicit InfoBarManager(content::WebContents* web_contents);
- ~InfoBarManager();
+ InfoBarManager();
+ virtual ~InfoBarManager();
+
+ // Must be called before destruction.
+ // TODO(droger): Merge this method with the destructor once the virtual calls
+ // for notifications are removed (see http://crbug.com/354380).
+ void ShutDown();
// Adds the specified |infobar|, which already owns a delegate.
//
@@ -42,7 +47,7 @@ class InfoBarManager {
// immediately without being added.
//
// Returns the infobar if it was successfully added.
- virtual InfoBar* AddInfoBar(scoped_ptr<InfoBar> infobar);
+ InfoBar* AddInfoBar(scoped_ptr<InfoBar> infobar);
// Removes the specified |infobar|. This in turn may close immediately or
// animate closed; at the end the infobar will delete itself.
@@ -76,20 +81,21 @@ class InfoBarManager {
// Warning: Does not sanity check |index|.
InfoBar* infobar_at(size_t index) { return infobars_[index]; }
- // Retrieve the WebContents for the tab this service is associated with.
- // Do not add new call sites for this.
- // TODO(droger): remove this method. See http://crbug.com/354379.
- content::WebContents* web_contents() { return web_contents_; }
-
// Must be called when a navigation happens.
void OnNavigation(const InfoBarDelegate::NavigationDetails& details);
- // Called when the associated WebContents is being destroyed.
- void OnWebContentsDestroyed();
-
void AddObserver(Observer* obs);
void RemoveObserver(Observer* obs);
+ protected:
+ // Notifies the observer in |observer_list_|.
+ // TODO(droger): Absorb these methods back into their callers once virtual
+ // overrides are removed (see http://crbug.com/354380).
+ virtual void NotifyInfoBarAdded(InfoBar* infobar);
+ virtual void NotifyInfoBarRemoved(InfoBar* infobar, bool animate);
+ virtual void NotifyInfoBarReplaced(InfoBar* old_infobar,
+ InfoBar* new_infobar);
+
private:
// InfoBars associated with this InfoBarManager. We own these pointers.
// However, this is not a ScopedVector, because we don't delete the infobars
@@ -103,9 +109,6 @@ class InfoBarManager {
InfoBars infobars_;
bool infobars_enabled_;
- // TODO(droger): remove this field. See http://crbug.com/354379.
- content::WebContents* web_contents_;
-
ObserverList<Observer, true> observer_list_;
DISALLOW_COPY_AND_ASSIGN(InfoBarManager);
diff --git a/chrome/browser/infobars/infobar_service.cc b/chrome/browser/infobars/infobar_service.cc
index 8a29830..a6a7d94 100644
--- a/chrome/browser/infobars/infobar_service.cc
+++ b/chrome/browser/infobars/infobar_service.cc
@@ -17,16 +17,6 @@
DEFINE_WEB_CONTENTS_USER_DATA_KEY(InfoBarService);
// static
-InfoBarManager* InfoBarService::InfoBarManagerFromWebContents(
- content::WebContents* web_contents) {
- InfoBarService* infobar_service = FromWebContents(web_contents);
- // |infobar_service| may be NULL during shutdown.
- if (!infobar_service)
- return NULL;
- return infobar_service->infobar_manager();
-}
-
-// static
InfoBarDelegate::NavigationDetails
InfoBarService::NavigationDetailsFromLoadCommittedDetails(
const content::LoadCommittedDetails& details) {
@@ -47,37 +37,67 @@ InfoBarDelegate::NavigationDetails
return navigation_details;
}
-InfoBar* InfoBarService::AddInfoBar(scoped_ptr<InfoBar> infobar) {
- return infobar_manager_.AddInfoBar(infobar.Pass());
-}
-
-InfoBar* InfoBarService::ReplaceInfoBar(InfoBar* old_infobar,
- scoped_ptr<InfoBar> new_infobar) {
- return infobar_manager_.ReplaceInfoBar(old_infobar, new_infobar.Pass());
+// static
+content::WebContents* InfoBarService::WebContentsFromInfoBar(InfoBar* infobar) {
+ if (!infobar || !infobar->owner())
+ return NULL;
+ InfoBarService* infobar_service =
+ static_cast<InfoBarService*>(infobar->owner());
+ return infobar_service->web_contents();
}
InfoBarService::InfoBarService(content::WebContents* web_contents)
- : content::WebContentsObserver(web_contents),
- infobar_manager_(web_contents) {
+ : content::WebContentsObserver(web_contents) {
DCHECK(web_contents);
- infobar_manager_.AddObserver(this);
}
-InfoBarService::~InfoBarService() {}
+InfoBarService::~InfoBarService() {
+ ShutDown();
+}
+
+void InfoBarService::NotifyInfoBarAdded(InfoBar* infobar) {
+ InfoBarManager::NotifyInfoBarAdded(infobar);
+ // TODO(droger): Remove the notifications and have listeners change to be
+ // NavigationManager::Observers instead. See http://crbug.com/354380
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
+ content::Source<InfoBarService>(this),
+ content::Details<InfoBar::AddedDetails>(infobar));
+}
+
+void InfoBarService::NotifyInfoBarRemoved(InfoBar* infobar, bool animate) {
+ InfoBarManager::NotifyInfoBarRemoved(infobar, animate);
+ // TODO(droger): Remove the notifications and have listeners change to be
+ // NavigationManager::Observers instead. See http://crbug.com/354380
+ InfoBar::RemovedDetails removed_details(infobar, animate);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
+ content::Source<InfoBarService>(this),
+ content::Details<InfoBar::RemovedDetails>(&removed_details));
+}
+
+void InfoBarService::NotifyInfoBarReplaced(InfoBar* old_infobar,
+ InfoBar* new_infobar) {
+ InfoBarManager::NotifyInfoBarReplaced(old_infobar, new_infobar);
+ // TODO(droger): Remove the notifications and have listeners change to be
+ // NavigationManager::Observers instead. See http://crbug.com/354380
+ InfoBar::ReplacedDetails replaced_details(old_infobar, new_infobar);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED,
+ content::Source<InfoBarService>(this),
+ content::Details<InfoBar::ReplacedDetails>(&replaced_details));
+}
void InfoBarService::RenderProcessGone(base::TerminationStatus status) {
- infobar_manager_.RemoveAllInfoBars(true);
+ RemoveAllInfoBars(true);
}
void InfoBarService::NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) {
- infobar_manager_.OnNavigation(
- NavigationDetailsFromLoadCommittedDetails(load_details));
+ OnNavigation(NavigationDetailsFromLoadCommittedDetails(load_details));
}
void InfoBarService::WebContentsDestroyed(content::WebContents* web_contents) {
- infobar_manager_.OnWebContentsDestroyed();
-
// The WebContents is going away; be aggressively paranoid and delete
// ourselves lest other parts of the system attempt to add infobars or use
// us otherwise during the destruction.
@@ -98,40 +118,6 @@ bool InfoBarService::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void InfoBarService::OnInfoBarAdded(InfoBar* infobar) {
- // TODO(droger): Remove the notifications and have listeners change to be
- // NavigationManager::Observers instead. See http://crbug.com/354380
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
- content::Source<InfoBarService>(this),
- content::Details<InfoBar::AddedDetails>(infobar));
-}
-
-void InfoBarService::OnInfoBarReplaced(InfoBar* old_infobar,
- InfoBar* new_infobar) {
- // TODO(droger): Remove the notifications and have listeners change to be
- // NavigationManager::Observers instead. See http://crbug.com/354380
- InfoBar::ReplacedDetails replaced_details(old_infobar, new_infobar);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED,
- content::Source<InfoBarService>(this),
- content::Details<InfoBar::ReplacedDetails>(&replaced_details));
-}
-
-void InfoBarService::OnInfoBarRemoved(InfoBar* infobar, bool animate) {
- // TODO(droger): Remove the notifications and have listeners change to be
- // NavigationManager::Observers instead. See http://crbug.com/354380
- InfoBar::RemovedDetails removed_details(infobar, animate);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
- content::Source<InfoBarService>(this),
- content::Details<InfoBar::RemovedDetails>(&removed_details));
-}
-
-void InfoBarService::OnManagerShuttingDown(InfoBarManager* manager) {
- infobar_manager_.RemoveObserver(this);
-}
-
void InfoBarService::OnDidBlockDisplayingInsecureContent() {
InsecureContentInfoBarDelegate::Create(
this, InsecureContentInfoBarDelegate::DISPLAY);
diff --git a/chrome/browser/infobars/infobar_service.h b/chrome/browser/infobars/infobar_service.h
index 5df4c80..152a5f7 100644
--- a/chrome/browser/infobars/infobar_service.h
+++ b/chrome/browser/infobars/infobar_service.h
@@ -21,37 +21,38 @@ class InfoBar;
// Associates a Tab to a InfoBarManager and manages its lifetime.
// It manages the infobar notifications and responds to navigation events.
-class InfoBarService : public content::WebContentsObserver,
- public content::WebContentsUserData<InfoBarService>,
- public InfoBarManager::Observer {
+class InfoBarService : public InfoBarManager,
+ public content::WebContentsObserver,
+ public content::WebContentsUserData<InfoBarService> {
public:
- // Helper function to get the InfoBarManager attached to |web_contents|.
- static InfoBarManager* InfoBarManagerFromWebContents(
- content::WebContents* web_contents);
-
static InfoBarDelegate::NavigationDetails
NavigationDetailsFromLoadCommittedDetails(
const content::LoadCommittedDetails& details);
- // These methods are simple pass-throughs to InfoBarManager, and are here to
- // prepare for the componentization of Infobars, see http://crbug.com/354379.
- InfoBar* AddInfoBar(scoped_ptr<InfoBar> infobar);
- InfoBar* ReplaceInfoBar(InfoBar* old_infobar,
- scoped_ptr<InfoBar> new_infobar);
+ // This function must only be called on infobars that are owned by an
+ // InfoBarService instance (or not owned at all, in which case this returns
+ // NULL).
+ static content::WebContents* WebContentsFromInfoBar(InfoBar* infobar);
// Retrieve the WebContents for the tab this service is associated with.
content::WebContents* web_contents() {
return content::WebContentsObserver::web_contents();
}
- InfoBarManager* infobar_manager() { return &infobar_manager_; }
-
private:
friend class content::WebContentsUserData<InfoBarService>;
explicit InfoBarService(content::WebContents* web_contents);
virtual ~InfoBarService();
+ // InfoBarManager:
+ // TODO(droger): Remove these functions once infobar notifications are
+ // removed. See http://crbug.com/354380
+ virtual void NotifyInfoBarAdded(InfoBar* infobar) OVERRIDE;
+ virtual void NotifyInfoBarRemoved(InfoBar* infobar, bool animate) OVERRIDE;
+ virtual void NotifyInfoBarReplaced(InfoBar* old_infobar,
+ InfoBar* new_infobar) OVERRIDE;
+
// content::WebContentsObserver:
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
virtual void NavigationEntryCommitted(
@@ -60,18 +61,10 @@ class InfoBarService : public content::WebContentsObserver,
content::WebContents* web_contents) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- // InfoBarManager::Observer:
- virtual void OnInfoBarAdded(InfoBar* infobar) OVERRIDE;
- virtual void OnInfoBarReplaced(InfoBar* old_infobar,
- InfoBar* new_infobar) OVERRIDE;
- virtual void OnInfoBarRemoved(InfoBar* infobar, bool animate) OVERRIDE;
- virtual void OnManagerShuttingDown(InfoBarManager* manager) OVERRIDE;
-
// Message handlers.
void OnDidBlockDisplayingInsecureContent();
void OnDidBlockRunningInsecureContent();
- InfoBarManager infobar_manager_;
DISALLOW_COPY_AND_ASSIGN(InfoBarService);
};
diff --git a/chrome/browser/infobars/infobars_browsertest.cc b/chrome/browser/infobars/infobars_browsertest.cc
index 415c9ed..17d71e4 100644
--- a/chrome/browser/infobars/infobars_browsertest.cc
+++ b/chrome/browser/infobars/infobars_browsertest.cc
@@ -7,7 +7,6 @@
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/theme_service.h"
@@ -82,9 +81,10 @@ IN_PROC_BROWSER_TEST_F(InfoBarsTest, TestInfoBarsCloseOnNewTheme) {
InstallExtension("theme2.crx");
infobar_added_2.Wait();
infobar_removed_1.Wait();
- EXPECT_EQ(0u,
- InfoBarService::FromWebContents(browser()->tab_strip_model()->
- GetWebContentsAt(0))->infobar_manager()->infobar_count());
+ EXPECT_EQ(
+ 0u,
+ InfoBarService::FromWebContents(
+ browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count());
content::WindowedNotificationObserver infobar_removed_2(
chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
@@ -92,6 +92,7 @@ IN_PROC_BROWSER_TEST_F(InfoBarsTest, TestInfoBarsCloseOnNewTheme) {
ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme();
infobar_removed_2.Wait();
EXPECT_EQ(0u,
- InfoBarService::FromWebContents(browser()->tab_strip_model()->
- GetActiveWebContents())->infobar_manager()->infobar_count());
+ InfoBarService::FromWebContents(
+ browser()->tab_strip_model()->GetActiveWebContents())->
+ infobar_count());
}
diff --git a/chrome/browser/infobars/insecure_content_infobar_delegate.cc b/chrome/browser/infobars/insecure_content_infobar_delegate.cc
index 3a42319..90d1cb7 100644
--- a/chrome/browser/infobars/insecure_content_infobar_delegate.cc
+++ b/chrome/browser/infobars/insecure_content_infobar_delegate.cc
@@ -8,7 +8,6 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
-#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/render_messages.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
@@ -27,9 +26,8 @@ void InsecureContentInfoBarDelegate::Create(InfoBarService* infobar_service,
// Only supsersede an existing insecure content infobar if we are upgrading
// from DISPLAY to RUN.
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
- InfoBar* old_infobar = infobar_manager->infobar_at(i);
+ for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBar* old_infobar = infobar_service->infobar_at(i);
InsecureContentInfoBarDelegate* delegate =
old_infobar->delegate()->AsInsecureContentInfoBarDelegate();
if (delegate != NULL) {
diff --git a/chrome/browser/managed_mode/managed_mode_interstitial.cc b/chrome/browser/managed_mode/managed_mode_interstitial.cc
index b651c09..4163ffb 100644
--- a/chrome/browser/managed_mode/managed_mode_interstitial.cc
+++ b/chrome/browser/managed_mode/managed_mode_interstitial.cc
@@ -11,7 +11,6 @@
#include "base/values.h"
#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_delegate.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/managed_mode/managed_user_service.h"
#include "chrome/browser/managed_mode/managed_user_service_factory.h"
@@ -53,7 +52,6 @@ ManagedModeInterstitial::ManagedModeInterstitial(
InfoBarService* service = InfoBarService::FromWebContents(web_contents);
if (service) {
- InfoBarManager* infobar_manager = service->infobar_manager();
// Remove all the infobars which are attached to |web_contents| and for
// which ShouldExpire() returns true.
content::LoadCommittedDetails details;
@@ -69,12 +67,12 @@ ManagedModeInterstitial::ManagedModeInterstitial(
details.previous_url = controller.GetLastCommittedEntry()->GetURL();
}
details.type = content::NAVIGATION_TYPE_NEW_PAGE;
- for (int i = infobar_manager->infobar_count() - 1; i >= 0; --i) {
- InfoBar* infobar = infobar_manager->infobar_at(i);
+ for (int i = service->infobar_count() - 1; i >= 0; --i) {
+ InfoBar* infobar = service->infobar_at(i);
if (infobar->delegate()->ShouldExpire(
InfoBarService::NavigationDetailsFromLoadCommittedDetails(
details)))
- infobar_manager->RemoveInfoBar(infobar);
+ service->RemoveInfoBar(infobar);
}
}
diff --git a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
index 11373e0..07304b8 100644
--- a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
+++ b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/managed_mode/managed_mode_interstitial.h"
#include "chrome/browser/managed_mode/managed_mode_resource_throttle.h"
@@ -188,9 +187,7 @@ void ManagedModeNavigationObserver::ProvisionalChangeToMainFrameUrl(
return;
// If we shouldn't have a warn infobar remove it here.
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(web_contents())->infobar_manager();
- infobar_manager->RemoveInfoBar(warn_infobar_);
+ InfoBarService::FromWebContents(web_contents())->RemoveInfoBar(warn_infobar_);
warn_infobar_ = NULL;
}
diff --git a/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc b/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
index f5592f2..1ec7e84 100644
--- a/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
+++ b/chrome/browser/media/chrome_media_stream_infobar_browsertest.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/media/webrtc_browsertest_base.h"
#include "chrome/browser/media/webrtc_browsertest_common.h"
@@ -122,9 +121,9 @@ IN_PROC_BROWSER_TEST_F(MediaStreamInfoBarTest,
EXPECT_TRUE(test::PollingWaitUntil("obtainGetUserMediaResult()",
kFailedWithPermissionDeniedError,
tab_contents));
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(tab_contents)->infobar_manager();
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(tab_contents);
+ EXPECT_EQ(0u, infobar_service->infobar_count());
}
// Failing on Win Aura, so disabling on that.
diff --git a/chrome/browser/media/media_stream_infobar_delegate.cc b/chrome/browser/media/media_stream_infobar_delegate.cc
index 35965c6..f3059d5 100644
--- a/chrome/browser/media/media_stream_infobar_delegate.cc
+++ b/chrome/browser/media/media_stream_infobar_delegate.cc
@@ -9,7 +9,6 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_contents.h"
@@ -55,9 +54,8 @@ bool MediaStreamInfoBarDelegate::Create(
scoped_ptr<InfoBar> infobar(ConfirmInfoBarDelegate::CreateInfoBar(
scoped_ptr<ConfirmInfoBarDelegate>(
new MediaStreamInfoBarDelegate(controller.Pass()))));
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
- InfoBar* old_infobar = infobar_manager->infobar_at(i);
+ for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBar* old_infobar = infobar_service->infobar_at(i);
if (old_infobar->delegate()->AsMediaStreamInfoBarDelegate()) {
infobar_service->ReplaceInfoBar(old_infobar, infobar.Pass());
return true;
diff --git a/chrome/browser/media/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc_browsertest_base.cc
index 6c1f823..a586029 100644
--- a/chrome/browser/media/webrtc_browsertest_base.cc
+++ b/chrome/browser/media/webrtc_browsertest_base.cc
@@ -9,7 +9,6 @@
#include "base/strings/stringprintf.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/media/media_stream_infobar_delegate.h"
#include "chrome/browser/media/webrtc_browsertest_common.h"
@@ -222,9 +221,9 @@ void WebRtcTestBase::CloseInfoBarInTab(
chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
content::NotificationService::AllSources());
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(tab_contents)->infobar_manager();
- infobar_manager->RemoveInfoBar(infobar);
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(tab_contents);
+ infobar_service->RemoveInfoBar(infobar);
infobar_removed.Wait();
}
diff --git a/chrome/browser/notifications/notification_browsertest.cc b/chrome/browser/notifications/notification_browsertest.cc
index 671db01..587ed7c 100644
--- a/chrome/browser/notifications/notification_browsertest.cc
+++ b/chrome/browser/notifications/notification_browsertest.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/notifications/balloon.h"
#include "chrome/browser/notifications/balloon_collection.h"
@@ -319,11 +318,10 @@ void NotificationsTest::AllowAllOrigins() {
void NotificationsTest::VerifyInfoBar(const Browser* browser, int index) {
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser->tab_strip_model()->GetWebContentsAt(index));
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- ASSERT_EQ(1U, infobar_manager->infobar_count());
+ ASSERT_EQ(1U, infobar_service->infobar_count());
ConfirmInfoBarDelegate* confirm_infobar =
- infobar_manager->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(confirm_infobar);
int buttons = confirm_infobar->GetButtons();
EXPECT_TRUE(buttons & ConfirmInfoBarDelegate::BUTTON_OK);
@@ -404,18 +402,17 @@ bool NotificationsTest::PerformActionOnInfoBar(
int tab_index) {
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser->tab_strip_model()->GetWebContentsAt(tab_index));
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- if (infobar_index >= infobar_manager->infobar_count()) {
+ if (infobar_index >= infobar_service->infobar_count()) {
ADD_FAILURE();
return false;
}
- InfoBar* infobar = infobar_manager->infobar_at(infobar_index);
+ InfoBar* infobar = infobar_service->infobar_at(infobar_index);
InfoBarDelegate* infobar_delegate = infobar->delegate();
switch (action) {
case DISMISS:
infobar_delegate->InfoBarDismissed();
- infobar_manager->RemoveInfoBar(infobar);
+ infobar_service->RemoveInfoBar(infobar);
return true;
case ALLOW: {
@@ -424,7 +421,7 @@ bool NotificationsTest::PerformActionOnInfoBar(
if (!confirm_infobar_delegate) {
ADD_FAILURE();
} else if (confirm_infobar_delegate->Accept()) {
- infobar_manager->RemoveInfoBar(infobar);
+ infobar_service->RemoveInfoBar(infobar);
return true;
}
}
@@ -435,7 +432,7 @@ bool NotificationsTest::PerformActionOnInfoBar(
if (!confirm_infobar_delegate) {
ADD_FAILURE();
} else if (confirm_infobar_delegate->Cancel()) {
- infobar_manager->RemoveInfoBar(infobar);
+ infobar_service->RemoveInfoBar(infobar);
return true;
}
}
@@ -501,7 +498,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestUserGestureInfobar) {
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetWebContentsAt(0));
- EXPECT_EQ(1U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service->infobar_count());
}
// If this flakes, use http://crbug.com/62311.
@@ -517,7 +514,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestNoUserGestureInfobar) {
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetWebContentsAt(0));
- EXPECT_EQ(0U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service->infobar_count());
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCreateSimpleNotification) {
@@ -659,7 +656,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestAllowNotificationsFromAllSites) {
ASSERT_EQ(1, GetNotificationCount());
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetWebContentsAt(0));
- EXPECT_EQ(0U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service->infobar_count());
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyNotificationsFromAllSites) {
@@ -727,7 +724,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsTest, TestDenyAndThenAllowDomain) {
ASSERT_EQ(1, GetNotificationCount());
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetWebContentsAt(0));
- EXPECT_EQ(0U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service->infobar_count());
}
IN_PROC_BROWSER_TEST_F(NotificationsTest, TestCreateDenyCloseNotifications) {
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc
index 26adbc0..435a43f 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -10,7 +10,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/password_manager/test_password_store_service.h"
@@ -76,11 +75,8 @@ class NavigationObserver : public content::NotificationObserver,
switch (type) {
case chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED:
if (should_automatically_accept_infobar_) {
- infobar_service_->infobar_manager()
- ->infobar_at(0)
- ->delegate()
- ->AsConfirmInfoBarDelegate()
- ->Accept();
+ infobar_service_->infobar_at(0)->delegate()->
+ AsConfirmInfoBarDelegate()->Accept();
}
infobar_shown_ = true;
return;
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 0a13e27..e621aee 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -40,7 +40,6 @@
#include "chrome/browser/extensions/updater/extension_cache_fake.h"
#include "chrome/browser/extensions/updater/extension_updater.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/media/media_stream_devices_controller.h"
@@ -1338,16 +1337,15 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, AlwaysAuthorizePlugins) {
ASSERT_TRUE(contents);
InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
ASSERT_TRUE(infobar_service);
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
base::FilePath path(FILE_PATH_LITERAL("plugin/quicktime.html"));
GURL url(URLRequestMockHTTPJob::GetMockUrl(path));
ui_test_utils::NavigateToURL(browser(), url);
// This should have triggered the dangerous plugin infobar.
- ASSERT_EQ(1u, infobar_manager->infobar_count());
+ ASSERT_EQ(1u, infobar_service->infobar_count());
EXPECT_TRUE(
- infobar_manager->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate());
+ infobar_service->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate());
// And the plugin isn't running.
EXPECT_EQ(0, CountPlugins());
@@ -1358,7 +1356,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, AlwaysAuthorizePlugins) {
UpdateProviderPolicy(policies);
// Reloading the page shouldn't trigger the infobar this time.
ui_test_utils::NavigateToURL(browser(), url);
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
// And the plugin started automatically.
EXPECT_EQ(1, CountPlugins());
}
@@ -1878,8 +1876,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
ASSERT_TRUE(contents);
InfoBarService* infobar_service = InfoBarService::FromWebContents(contents);
ASSERT_TRUE(infobar_service);
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
// Force enable the translate feature.
PolicyMap policies;
@@ -1912,8 +1909,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
EXPECT_FALSE(language_state.IsPageTranslated());
// Verify that the translate infobar showed up.
- ASSERT_EQ(1u, infobar_manager->infobar_count());
- InfoBar* infobar = infobar_manager->infobar_at(0);
+ ASSERT_EQ(1u, infobar_service->infobar_count());
+ InfoBar* infobar = infobar_service->infobar_at(0);
TranslateInfoBarDelegate* translate_infobar_delegate =
infobar->delegate()->AsTranslateInfoBarDelegate();
ASSERT_TRUE(translate_infobar_delegate);
@@ -1922,8 +1919,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
EXPECT_EQ("fr", translate_infobar_delegate->original_language_code());
// Now force disable translate.
- infobar_manager->RemoveInfoBar(infobar);
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ infobar_service->RemoveInfoBar(infobar);
+ EXPECT_EQ(0u, infobar_service->infobar_count());
policies.Set(key::kTranslateEnabled, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, base::Value::CreateBooleanValue(false), NULL);
UpdateProviderPolicy(policies);
@@ -1933,7 +1930,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, DISABLED_TranslateEnabled) {
content::NotificationService::AllSources());
ui_test_utils::NavigateToURL(browser(), url);
language_observer2.Wait();
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ EXPECT_EQ(0u, infobar_service->infobar_count());
}
IN_PROC_BROWSER_TEST_F(PolicyTest, URLBlacklist) {
diff --git a/chrome/browser/translate/translate_browsertest.cc b/chrome/browser/translate/translate_browsertest.cc
index e666aed..7c0bef7 100644
--- a/chrome/browser/translate/translate_browsertest.cc
+++ b/chrome/browser/translate/translate_browsertest.cc
@@ -92,19 +92,19 @@ class TranslateBrowserTest : public InProcessBrowserTest {
}
TranslateInfoBarDelegate* delegate = NULL;
- InfoBarManager* infobar_manager = infobar_service_->infobar_manager();
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
+ for (size_t i = 0; i < infobar_service_->infobar_count(); ++i) {
// Check if the shown infobar is a confirm infobar coming from the
// |kTranslateSecurityOrigin| flag specified in SetUpCommandLine().
// This infobar appears in all tests of TranslateBrowserTest and can be
// ignored here.
- ConfirmInfoBarDelegate* confirm = infobar_manager->infobar_at(i)
- ->delegate()->AsConfirmInfoBarDelegate();
- if (confirm)
+ if (infobar_service_->infobar_at(i)->delegate()->
+ AsConfirmInfoBarDelegate()) {
continue;
+ }
- TranslateInfoBarDelegate* translate = infobar_manager->infobar_at(i)
- ->delegate()->AsTranslateInfoBarDelegate();
+ TranslateInfoBarDelegate* translate =
+ infobar_service_->infobar_at(i)->delegate()->
+ AsTranslateInfoBarDelegate();
if (translate) {
EXPECT_FALSE(delegate) << "multiple infobars are shown unexpectedly";
delegate = translate;
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc
index bcfb5ae0..6eef845 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -11,7 +11,6 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/translate/translate_tab_helper.h"
@@ -89,10 +88,9 @@ void TranslateInfoBarDelegate::Create(bool replace_existing_infobar,
InfoBar* old_infobar = NULL;
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
TranslateInfoBarDelegate* old_delegate = NULL;
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
- old_infobar = infobar_manager->infobar_at(i);
+ for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ old_infobar = infobar_service->infobar_at(i);
old_delegate = old_infobar->delegate()->AsTranslateInfoBarDelegate();
if (old_delegate) {
if (!replace_existing_infobar)
diff --git a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc
index d5e428a..71e13f2 100644
--- a/chrome/browser/translate/translate_manager_render_view_host_unittest.cc
+++ b/chrome/browser/translate/translate_manager_render_view_host_unittest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h"
#include "chrome/browser/translate/translate_infobar_delegate.h"
@@ -148,19 +147,13 @@ class TranslateManagerRenderViewHostTest
return InfoBarService::FromWebContents(web_contents());
}
- InfoBarManager* infobar_manager() {
- return infobar_service()->infobar_manager();
- }
-
// Returns the translate infobar if there is 1 infobar and it is a translate
// infobar.
TranslateInfoBarDelegate* GetTranslateInfoBar() {
- return (infobar_manager()->infobar_count() == 1)
- ? infobar_manager()
- ->infobar_at(0)
- ->delegate()
- ->AsTranslateInfoBarDelegate()
- : NULL;
+ return (infobar_service()->infobar_count() == 1) ?
+ infobar_service()->infobar_at(0)->delegate()->
+ AsTranslateInfoBarDelegate() :
+ NULL;
}
// If there is 1 infobar and it is a translate infobar, closes it and returns
@@ -170,7 +163,7 @@ class TranslateManagerRenderViewHostTest
if (!infobar)
return false;
infobar->InfoBarDismissed(); // Simulates closing the infobar.
- infobar_manager()->RemoveInfoBar(infobar_manager()->infobar_at(0));
+ infobar_service()->RemoveInfoBar(infobar_service()->infobar_at(0));
return true;
}
@@ -194,7 +187,7 @@ class TranslateManagerRenderViewHostTest
if (!infobar)
return false;
infobar->TranslationDeclined();
- infobar_manager()->RemoveInfoBar(infobar_manager()->infobar_at(0));
+ infobar_service()->RemoveInfoBar(infobar_service()->infobar_at(0));
return true;
}
@@ -749,18 +742,18 @@ TEST_F(TranslateManagerRenderViewHostTest, MultipleOnPageContents) {
// Simulate clicking 'Nope' (don't translate).
EXPECT_TRUE(DenyTranslation());
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Send a new PageContents, we should not show an infobar.
SimulateOnTranslateLanguageDetermined("fr", true);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
// Do the same steps but simulate closing the infobar this time.
SimulateNavigation(GURL("http://www.youtube.fr"), "fr", true);
EXPECT_TRUE(CloseTranslateInfoBar());
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
SimulateOnTranslateLanguageDetermined("fr", true);
- EXPECT_EQ(0U, infobar_manager()->infobar_count());
+ EXPECT_EQ(0U, infobar_service()->infobar_count());
}
// Test that reloading the page brings back the infobar if the
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 ca2632d..62a5940 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
@@ -7,7 +7,6 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
@@ -29,21 +28,21 @@ void PopupBlockedInfoBarDelegate::Create(content::WebContents* web_contents,
new PopupBlockedInfoBarDelegate(
num_popups, url, profile->GetHostContentSettingsMap()))));
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(web_contents)->infobar_manager();
+ 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.
// This will be fixed once we have an in place replace infobar mechanism.
- for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
- InfoBar* existing_infobar = infobar_manager->infobar_at(i);
+ for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBar* existing_infobar = infobar_service->infobar_at(i);
if (existing_infobar->delegate()->AsPopupBlockedInfoBarDelegate()) {
- infobar_manager->ReplaceInfoBar(existing_infobar, infobar.Pass());
+ infobar_service->ReplaceInfoBar(existing_infobar, infobar.Pass());
return;
}
}
- infobar_manager->AddInfoBar(infobar.Pass());
+ infobar_service->AddInfoBar(infobar.Pass());
}
PopupBlockedInfoBarDelegate::~PopupBlockedInfoBarDelegate() {
diff --git a/chrome/browser/ui/android/infobars/infobar_container_android.cc b/chrome/browser/ui/android/infobars/infobar_container_android.cc
index 9c0da6e..fd9d565 100644
--- a/chrome/browser/ui/android/infobars/infobar_container_android.cc
+++ b/chrome/browser/ui/android/infobars/infobar_container_android.cc
@@ -90,10 +90,9 @@ static jlong Init(JNIEnv* env,
jobject auto_login_delegate) {
InfoBarContainerAndroid* infobar_container =
new InfoBarContainerAndroid(env, obj, auto_login_delegate);
- InfoBarManager* infobar_manager =
- InfoBarService::InfoBarManagerFromWebContents(
- content::WebContents::FromJavaWebContents(web_contents));
- infobar_container->ChangeInfoBarManager(infobar_manager);
+ InfoBarService* infobar_service = InfoBarService::FromWebContents(
+ content::WebContents::FromJavaWebContents(web_contents));
+ infobar_container->ChangeInfoBarManager(infobar_service);
return reinterpret_cast<intptr_t>(infobar_container);
}
diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm
index bd89a53..e7eb9d4 100644
--- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm
@@ -94,8 +94,7 @@ class ConfirmInfoBarControllerTest : public CocoaProfileTest,
scoped_ptr<InfoBarDelegate> delegate(
new MockConfirmInfoBarDelegate(this));
infobar_ = new InfoBarCocoa(delegate.Pass());
- infobar_->SetOwner(InfoBarService::FromWebContents(
- web_contents_.get())->infobar_manager());
+ infobar_->SetOwner(InfoBarService::FromWebContents(web_contents_.get()));
controller_.reset([[TestConfirmInfoBarController alloc]
initWithInfoBar:infobar_]);
diff --git a/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm
index 34b5feb..f2126d6 100644
--- a/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm
+++ b/chrome/browser/ui/cocoa/infobars/extension_infobar_controller.mm
@@ -246,7 +246,7 @@ class InfobarBridge {
extensions::ExtensionViewHost* extensionViewHost =
[self delegate]->AsExtensionInfoBarDelegate()->extension_view_host();
Browser* browser = chrome::FindBrowserWithWebContents(
- [self infobar]->OwnerCocoa()->web_contents());
+ [self delegate]->AsExtensionInfoBarDelegate()->web_contents());
contextMenuController_.reset([[ExtensionActionContextMenuController alloc]
initWithExtension:extensionViewHost->extension()
browser:browser
diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm
index f33638c..b5e7aed 100644
--- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm
+++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller.mm
@@ -68,10 +68,9 @@
- (void)changeWebContents:(content::WebContents*)contents {
currentWebContents_ = contents;
- InfoBarManager* infobar_manager = NULL;
- if (contents)
- infobar_manager = InfoBarService::InfoBarManagerFromWebContents(contents);
- containerCocoa_->ChangeInfoBarManager(infobar_manager);
+ InfoBarService* infobar_service =
+ contents ? InfoBarService::FromWebContents(contents) : NULL;
+ containerCocoa_->ChangeInfoBarManager(infobar_service);
}
- (void)tabDetachedWithContents:(content::WebContents*)contents {
diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm
index 2e6f4cc..13b85db8 100644
--- a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm
+++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm
@@ -104,8 +104,7 @@ class TranslationInfoBarTest : public CocoaProfileTest {
if (infobar_)
infobar_->CloseSoon();
infobar_ = static_cast<InfoBarCocoa*>(infobar.release());
- infobar_->SetOwner(InfoBarService::FromWebContents(web_contents_.get())
- ->infobar_manager());
+ infobar_->SetOwner(InfoBarService::FromWebContents(web_contents_.get()));
infobar_controller_.reset([static_cast<TranslateInfoBarControllerBase*>(
infobar_->controller()) retain]);
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
index 7af803f..50b1239 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/infobars/infobar_delegate.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/profiles/profile.h"
@@ -235,9 +234,9 @@ TEST_F(ContentSettingBubbleModelTest, BlockedMediastreamMicAndCamera) {
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
std::string()));
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(web_contents())->infobar_manager();
- infobar_manager->RemoveInfoBar(infobar_manager->infobar_at(0));
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents());
+ infobar_service->RemoveInfoBar(infobar_service->infobar_at(0));
}
TEST_F(ContentSettingBubbleModelTest, MediastreamMic) {
diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc
index b4001e4..cc6928c 100644
--- a/chrome/browser/ui/gtk/browser_window_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_window_gtk.cc
@@ -802,9 +802,8 @@ void BrowserWindowGtk::OnActiveTabChanged(WebContents* old_contents,
// Update various elements that are interested in knowing the current
// WebContents.
- InfoBarManager* infobar_manager =
- InfoBarService::InfoBarManagerFromWebContents(new_contents);
- infobar_container_->ChangeInfoBarManager(infobar_manager);
+ infobar_container_->ChangeInfoBarManager(
+ InfoBarService::FromWebContents(new_contents));
contents_container_->SetTab(new_contents);
UpdateDevToolsForContents(new_contents);
diff --git a/chrome/browser/ui/hung_plugin_tab_helper.cc b/chrome/browser/ui/hung_plugin_tab_helper.cc
index 5907a6c7..229f044 100644
--- a/chrome/browser/ui/hung_plugin_tab_helper.cc
+++ b/chrome/browser/ui/hung_plugin_tab_helper.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/browser_child_process_host_iterator.h"
@@ -279,14 +278,13 @@ void HungPluginTabHelper::PluginCrashed(const base::FilePath& plugin_path,
if (!infobar_service)
return;
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
// For now, just do a brute-force search to see if we have this plugin. Since
// we'll normally have 0 or 1, this is fast.
for (PluginStateMap::iterator i = hung_plugins_.begin();
i != hung_plugins_.end(); ++i) {
if (i->second->path == plugin_path) {
if (i->second->infobar)
- infobar_manager->RemoveInfoBar(i->second->infobar);
+ infobar_service->RemoveInfoBar(i->second->infobar);
hung_plugins_.erase(i);
break;
}
@@ -302,13 +300,12 @@ void HungPluginTabHelper::PluginHungStatusChanged(
if (!infobar_service)
return;
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
PluginStateMap::iterator found = hung_plugins_.find(plugin_child_id);
if (found != hung_plugins_.end()) {
if (!is_hung) {
// Hung plugin became un-hung, close the infobar and delete our info.
if (found->second->infobar)
- infobar_manager->RemoveInfoBar(found->second->infobar);
+ infobar_service->RemoveInfoBar(found->second->infobar);
hung_plugins_.erase(found);
}
return;
@@ -419,7 +416,7 @@ void HungPluginTabHelper::CloseBar(PluginState* state) {
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents());
if (infobar_service && state->infobar) {
- infobar_service->infobar_manager()->RemoveInfoBar(state->infobar);
+ infobar_service->RemoveInfoBar(state->infobar);
state->infobar = NULL;
}
}
diff --git a/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc b/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc
index 97701e9..5887b7b 100644
--- a/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc
+++ b/chrome/browser/ui/startup/session_crashed_infobar_delegate_unittest.cc
@@ -8,7 +8,6 @@
#include "base/prefs/testing_pref_service.h"
#include "base/run_loop.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/sessions/session_service_factory.h"
@@ -82,11 +81,11 @@ TEST_F(SessionCrashedInfoBarDelegateUnitTest, DetachingTabWithCrashedInfoBar) {
TabStripModel* tab_strip = first_browser->tab_strip_model();
ASSERT_EQ(1, tab_strip->count());
content::WebContents* web_contents = tab_strip->GetWebContentsAt(0);
- InfoBarManager* infobar_manager =
- InfoBarService::FromWebContents(web_contents)->infobar_manager();
- EXPECT_EQ(1U, infobar_manager->infobar_count());
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents);
+ EXPECT_EQ(1U, infobar_service->infobar_count());
ConfirmInfoBarDelegate* infobar =
- infobar_manager->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
+ infobar_service->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(infobar);
// Open another browser.
@@ -103,9 +102,9 @@ TEST_F(SessionCrashedInfoBarDelegateUnitTest, DetachingTabWithCrashedInfoBar) {
first_browser.reset();
ASSERT_EQ(1, tab_strip->count());
- InfoBarService* infobar_service =
+ infobar_service =
InfoBarService::FromWebContents(tab_strip->GetWebContentsAt(0));
- EXPECT_EQ(1U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service->infobar_count());
// This used to crash.
infobar->Accept();
diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
index d89227c..4cd3edc 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/first_run/first_run.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/managed_mode/managed_mode_navigation_observer.h"
#include "chrome/browser/managed_mode/managed_user_service.h"
@@ -941,7 +940,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) {
EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL());
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
- EXPECT_EQ(1U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service->infobar_count());
// The profile which normally opens last open pages displays the new tab page.
ASSERT_EQ(1u, chrome::GetBrowserCount(profile_last,
@@ -953,7 +952,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) {
web_contents = tab_strip->GetWebContentsAt(0);
EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL());
infobar_service = InfoBarService::FromWebContents(web_contents);
- EXPECT_EQ(1U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service->infobar_count());
// The profile which normally opens URLs displays the new tab page.
ASSERT_EQ(1u, chrome::GetBrowserCount(profile_urls,
@@ -965,7 +964,7 @@ IN_PROC_BROWSER_TEST_F(StartupBrowserCreatorTest, ProfilesLaunchedAfterCrash) {
web_contents = tab_strip->GetWebContentsAt(0);
EXPECT_EQ(GURL(chrome::kChromeUINewTabURL), web_contents->GetURL());
infobar_service = InfoBarService::FromWebContents(web_contents);
- EXPECT_EQ(1U, infobar_service->infobar_manager()->infobar_count());
+ EXPECT_EQ(1U, infobar_service->infobar_count());
}
class ManagedModeBrowserCreatorTest : public InProcessBrowserTest {
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 932d6e2..c8c819b 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -832,9 +832,8 @@ void BrowserView::OnActiveTabChanged(content::WebContents* old_contents,
devtools_web_view_->SetWebContents(NULL);
}
- InfoBarManager* infobar_manager =
- InfoBarService::InfoBarManagerFromWebContents(new_contents);
- infobar_container_->ChangeInfoBarManager(infobar_manager);
+ infobar_container_->ChangeInfoBarManager(
+ InfoBarService::FromWebContents(new_contents));
if (old_contents && PermissionBubbleManager::FromWebContents(old_contents))
PermissionBubbleManager::FromWebContents(old_contents)->SetView(NULL);
diff --git a/chrome/browser/ui/website_settings/website_settings_unittest.cc b/chrome/browser/ui/website_settings/website_settings_unittest.cc
index 8f1645c..fd1c622 100644
--- a/chrome/browser/ui/website_settings/website_settings_unittest.cc
+++ b/chrome/browser/ui/website_settings/website_settings_unittest.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/ui/website_settings/website_settings_ui.h"
#include "chrome/common/content_settings.h"
@@ -365,9 +364,9 @@ TEST_F(WebsiteSettingsTest, NoInfoBar) {
SetDefaultUIExpectations(mock_ui());
EXPECT_CALL(*mock_ui(), SetSelectedTab(
WebsiteSettingsUI::TAB_ID_PERMISSIONS));
- EXPECT_EQ(0u, infobar_service()->infobar_manager()->infobar_count());
+ EXPECT_EQ(0u, infobar_service()->infobar_count());
website_settings()->OnUIClosing();
- EXPECT_EQ(0u, infobar_service()->infobar_manager()->infobar_count());
+ EXPECT_EQ(0u, infobar_service()->infobar_count());
}
TEST_F(WebsiteSettingsTest, ShowInfoBar) {
@@ -387,12 +386,11 @@ TEST_F(WebsiteSettingsTest, ShowInfoBar) {
EXPECT_CALL(*mock_ui(), SetSelectedTab(
WebsiteSettingsUI::TAB_ID_PERMISSIONS));
- InfoBarManager* infobar_manager = infobar_service()->infobar_manager();
- EXPECT_EQ(0u, infobar_manager->infobar_count());
+ EXPECT_EQ(0u, infobar_service()->infobar_count());
website_settings()->OnSitePermissionChanged(
CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW);
website_settings()->OnUIClosing();
- ASSERT_EQ(1u, infobar_manager->infobar_count());
+ ASSERT_EQ(1u, infobar_service()->infobar_count());
- infobar_manager->RemoveInfoBar(infobar_manager->infobar_at(0));
+ infobar_service()->RemoveInfoBar(infobar_service()->infobar_at(0));
}
diff --git a/chrome/test/gpu/webgl_infobar_browsertest.cc b/chrome/test/gpu/webgl_infobar_browsertest.cc
index 9d376d3..8040cae 100644
--- a/chrome/test/gpu/webgl_infobar_browsertest.cc
+++ b/chrome/test/gpu/webgl_infobar_browsertest.cc
@@ -8,7 +8,6 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -91,8 +90,8 @@ IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, DISABLED_ContextLossRaisesInfoBar) {
infobar_added.Wait();
EXPECT_EQ(1u,
InfoBarService::FromWebContents(
- browser()->tab_strip_model()->GetActiveWebContents())
- ->infobar_manager()->infobar_count());
+ browser()->tab_strip_model()->GetActiveWebContents())->
+ infobar_count());
}
// This test is flaky. http://crbug.com/324555
@@ -132,9 +131,8 @@ IN_PROC_BROWSER_TEST_F(WebGLInfoBarTest, DISABLED_ContextLossInfoBarReload) {
infobar_added.Wait();
InfoBarService* infobar_service = InfoBarService::FromWebContents(
browser()->tab_strip_model()->GetActiveWebContents());
- ASSERT_EQ(1u, infobar_service->infobar_manager()->infobar_count());
- InfoBarDelegate* delegate =
- infobar_service->infobar_manager()->infobar_at(0)->delegate();
+ ASSERT_EQ(1u, infobar_service->infobar_count());
+ InfoBarDelegate* delegate = infobar_service->infobar_at(0)->delegate();
ASSERT_EQ(IDR_INFOBAR_3D_BLOCKED, delegate->GetIconID());
delegate->AsConfirmInfoBarDelegate()->Cancel();
diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc
index 99d233d..8e22b24 100644
--- a/chrome/test/ppapi/ppapi_test.cc
+++ b/chrome/test/ppapi/ppapi_test.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
-#include "chrome/browser/infobars/infobar_manager.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -112,13 +111,12 @@ void PPAPITestBase::InfoBarObserver::VerifyInfoBarState() {
InfoBarService::FromWebContents(web_contents);
ASSERT_TRUE(infobar_service != NULL);
- InfoBarManager* infobar_manager = infobar_service->infobar_manager();
- EXPECT_EQ(expecting_infobar_ ? 1U : 0U, infobar_manager->infobar_count());
+ EXPECT_EQ(expecting_infobar_ ? 1U : 0U, infobar_service->infobar_count());
if (!expecting_infobar_)
return;
expecting_infobar_ = false;
- InfoBar* infobar = infobar_manager->infobar_at(0);
+ InfoBar* infobar = infobar_service->infobar_at(0);
ConfirmInfoBarDelegate* delegate =
infobar->delegate()->AsConfirmInfoBarDelegate();
ASSERT_TRUE(delegate != NULL);
@@ -127,7 +125,7 @@ void PPAPITestBase::InfoBarObserver::VerifyInfoBarState() {
else
delegate->Cancel();
- infobar_manager->RemoveInfoBar(infobar);
+ infobar_service->RemoveInfoBar(infobar);
}
PPAPITestBase::PPAPITestBase() {