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

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 211273007: Split InfoBarService core code into InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 12fc4d3f420db621d73a105d5ae3e1d8a21b9793..95590bb8402d378286447a503ce9c1cb7fafe15f 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -63,6 +63,7 @@
#include "chrome/browser/history/top_sites.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/lifetime/application_lifetime.h"
#include "chrome/browser/notifications/balloon.h"
@@ -1995,10 +1996,11 @@ void TestingAutomationProvider::SetWindowDimensions(
base::ListValue* TestingAutomationProvider::GetInfobarsInfo(WebContents* wc) {
// Each infobar may have different properties depending on the type.
base::ListValue* infobars = new base::ListValue;
- InfoBarService* infobar_service = InfoBarService::FromWebContents(wc);
- for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
+ InfoBarManager* infobar_manager =
+ InfoBarService::FromWebContents(wc)->infobar_manager();
+ for (size_t i = 0; i < infobar_manager->infobar_count(); ++i) {
base::DictionaryValue* infobar_item = new base::DictionaryValue;
- InfoBarDelegate* infobar = infobar_service->infobar_at(i)->delegate();
+ InfoBarDelegate* infobar = infobar_manager->infobar_at(i)->delegate();
switch (infobar->GetInfoBarAutomationType()) {
case InfoBarDelegate::CONFIRM_INFOBAR:
infobar_item->SetString("type", "confirm_infobar");
@@ -2072,19 +2074,19 @@ void TestingAutomationProvider::PerformActionOnInfobar(
return;
}
- InfoBarService* infobar_service =
- InfoBarService::FromWebContents(web_contents);
- if (infobar_index >= infobar_service->infobar_count()) {
+ InfoBarManager* infobar_manager =
+ InfoBarService::FromWebContents(web_contents)->infobar_manager();
+ if (infobar_index >= infobar_manager->infobar_count()) {
reply.SendError(base::StringPrintf("No such infobar at index %" PRIuS,
infobar_index));
return;
}
- InfoBar* infobar = infobar_service->infobar_at(infobar_index);
+ InfoBar* infobar = infobar_manager->infobar_at(infobar_index);
InfoBarDelegate* infobar_delegate = infobar->delegate();
if (action == "dismiss") {
infobar_delegate->InfoBarDismissed();
- infobar_service->RemoveInfoBar(infobar);
+ infobar_manager->RemoveInfoBar(infobar);
reply.SendSuccess(NULL);
return;
}
@@ -2097,7 +2099,7 @@ void TestingAutomationProvider::PerformActionOnInfobar(
}
if ((action == "accept") ?
confirm_infobar_delegate->Accept() : confirm_infobar_delegate->Cancel())
- infobar_service->RemoveInfoBar(infobar);
+ infobar_manager->RemoveInfoBar(infobar);
reply.SendSuccess(NULL);
return;
}

Powered by Google App Engine
This is Rietveld 408576698