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

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

Issue 7810002: Move infobar handling to a tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 4 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/automation_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 0679c97560bfa1711d5f97d464c616e42c1cfeeb..f44ec0c4185e8fb8d20f91c3e1a7890377b0d40b 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -33,6 +33,7 @@
#include "chrome/browser/extensions/extension_updater.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/history/top_sites.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/metrics/metric_event_duration_details.h"
#include "chrome/browser/notifications/balloon.h"
#include "chrome/browser/notifications/balloon_collection.h"
@@ -1372,7 +1373,7 @@ void InfoBarCountObserver::Observe(int type,
}
void InfoBarCountObserver::CheckCount() {
- if (tab_contents_->infobar_count() != target_count_)
+ if (tab_contents_->infobar_tab_helper()->infobar_count() != target_count_)
return;
if (automation_) {
@@ -2289,9 +2290,10 @@ AutofillFormSubmittedObserver::~AutofillFormSubmittedObserver() {
if (tab_contents_) {
InfoBarDelegate* infobar = NULL;
- if (tab_contents_->infobar_count() > 0 &&
- (infobar = tab_contents_->GetInfoBarDelegateAt(0))) {
- tab_contents_->RemoveInfoBar(infobar);
+ if (tab_contents_->infobar_tab_helper()->infobar_count() > 0 &&
Peter Kasting 2011/08/31 18:47:32 Nit: Can you pull the infobar_tab_helper() out to
+ (infobar =
+ tab_contents_->infobar_tab_helper()->GetInfoBarDelegateAt(0))) {
+ tab_contents_->infobar_tab_helper()->RemoveInfoBar(infobar);
}
}
}
@@ -2320,7 +2322,8 @@ void AutofillFormSubmittedObserver::Observe(
// Accept in the infobar.
tab_contents_ = Source<TabContentsWrapper>(source).ptr();
InfoBarDelegate* infobar = NULL;
- if (!(infobar = tab_contents_->GetInfoBarDelegateAt(0))) {
+ if (!(infobar =
Peter Kasting 2011/08/31 18:47:32 Nit: While here, remove this conditional entirely
+ tab_contents_->infobar_tab_helper()->GetInfoBarDelegateAt(0))) {
if (automation_) {
AutomationJSONReply(
automation_, reply_message_.release()).SendError(

Powered by Google App Engine
This is Rietveld 408576698