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

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

Issue 22694006: Infobar system refactor. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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
===================================================================
--- chrome/browser/automation/testing_automation_provider.cc (revision 238220)
+++ chrome/browser/automation/testing_automation_provider.cc (working copy)
@@ -63,6 +63,7 @@
#include "chrome/browser/history/history_service_factory.h"
#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_service.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/notifications/balloon.h"
@@ -1998,7 +1999,7 @@
InfoBarService* infobar_service = InfoBarService::FromWebContents(wc);
for (size_t i = 0; i < infobar_service->infobar_count(); ++i) {
DictionaryValue* infobar_item = new DictionaryValue;
- InfoBarDelegate* infobar = infobar_service->infobar_at(i);
+ InfoBarDelegate* infobar = infobar_service->infobar_at(i)->delegate();
switch (infobar->GetInfoBarAutomationType()) {
case InfoBarDelegate::CONFIRM_INFOBAR:
infobar_item->SetString("type", "confirm_infobar");
@@ -2079,12 +2080,12 @@
infobar_index));
return;
}
- InfoBarDelegate* infobar_delegate =
- infobar_service->infobar_at(infobar_index);
+ InfoBar* infobar = infobar_service->infobar_at(infobar_index);
+ InfoBarDelegate* infobar_delegate = infobar->delegate();
if (action == "dismiss") {
infobar_delegate->InfoBarDismissed();
- infobar_service->RemoveInfoBar(infobar_delegate);
+ infobar_service->RemoveInfoBar(infobar);
reply.SendSuccess(NULL);
return;
}
@@ -2097,7 +2098,7 @@
}
if ((action == "accept") ?
confirm_infobar_delegate->Accept() : confirm_infobar_delegate->Cancel())
- infobar_service->RemoveInfoBar(infobar_delegate);
+ infobar_service->RemoveInfoBar(infobar);
reply.SendSuccess(NULL);
return;
}
« no previous file with comments | « chrome/browser/autofill/autofill_interactive_uitest.cc ('k') | chrome/browser/chrome_quota_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698