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

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

Issue 102163002: Revert 238283 "Infobar system refactor." (Closed) Base URL: svn://svn.chromium.org/chrome/
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: trunk/src/chrome/browser/automation/testing_automation_provider.cc
===================================================================
--- trunk/src/chrome/browser/automation/testing_automation_provider.cc (revision 238400)
+++ trunk/src/chrome/browser/automation/testing_automation_provider.cc (working copy)
@@ -63,7 +63,6 @@
#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"
@@ -1999,7 +1998,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)->delegate();
+ InfoBarDelegate* infobar = infobar_service->infobar_at(i);
switch (infobar->GetInfoBarAutomationType()) {
case InfoBarDelegate::CONFIRM_INFOBAR:
infobar_item->SetString("type", "confirm_infobar");
@@ -2080,12 +2079,12 @@
infobar_index));
return;
}
- InfoBar* infobar = infobar_service->infobar_at(infobar_index);
- InfoBarDelegate* infobar_delegate = infobar->delegate();
+ InfoBarDelegate* infobar_delegate =
+ infobar_service->infobar_at(infobar_index);
if (action == "dismiss") {
infobar_delegate->InfoBarDismissed();
- infobar_service->RemoveInfoBar(infobar);
+ infobar_service->RemoveInfoBar(infobar_delegate);
reply.SendSuccess(NULL);
return;
}
@@ -2098,7 +2097,7 @@
}
if ((action == "accept") ?
confirm_infobar_delegate->Accept() : confirm_infobar_delegate->Cancel())
- infobar_service->RemoveInfoBar(infobar);
+ infobar_service->RemoveInfoBar(infobar_delegate);
reply.SendSuccess(NULL);
return;
}

Powered by Google App Engine
This is Rietveld 408576698