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

Unified Diff: chrome/browser/google/google_url_tracker.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/google/google_url_tracker.cc
===================================================================
--- chrome/browser/google/google_url_tracker.cc (revision 238220)
+++ chrome/browser/google/google_url_tracker.cc (working copy)
@@ -13,6 +13,7 @@
#include "chrome/browser/google/google_url_tracker_infobar_delegate.h"
#include "chrome/browser/google/google_url_tracker_navigation_helper.h"
#include "chrome/browser/google/google_util.h"
+#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
@@ -348,12 +349,13 @@
if (map_entry->has_infobar_delegate()) {
map_entry->infobar_delegate()->Update(search_url);
} else {
- GoogleURLTrackerInfoBarDelegate* infobar =
- infobar_creator_.Run(infobar_service, this, search_url);
- if (infobar)
- map_entry->SetInfoBarDelegate(infobar);
- else
+ InfoBar* infobar = infobar_creator_.Run(infobar_service, this, search_url);
+ if (infobar) {
+ map_entry->SetInfoBarDelegate(
+ static_cast<GoogleURLTrackerInfoBarDelegate*>(infobar->delegate()));
+ } else {
map_entry->Close(false);
+ }
}
}
« no previous file with comments | « chrome/browser/google/google_url_tracker.h ('k') | chrome/browser/google/google_url_tracker_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698