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

Unified Diff: trunk/src/chrome/browser/google/google_url_tracker_infobar_delegate.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/google/google_url_tracker_infobar_delegate.cc
===================================================================
--- trunk/src/chrome/browser/google/google_url_tracker_infobar_delegate.cc (revision 238401)
+++ trunk/src/chrome/browser/google/google_url_tracker_infobar_delegate.cc (working copy)
@@ -6,7 +6,6 @@
#include "chrome/browser/google/google_url_tracker.h"
#include "chrome/browser/google/google_util.h"
-#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
@@ -18,13 +17,14 @@
// static
-InfoBar* GoogleURLTrackerInfoBarDelegate::Create(
+GoogleURLTrackerInfoBarDelegate* GoogleURLTrackerInfoBarDelegate::Create(
InfoBarService* infobar_service,
GoogleURLTracker* google_url_tracker,
const GURL& search_url) {
- return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
- scoped_ptr<ConfirmInfoBarDelegate>(new GoogleURLTrackerInfoBarDelegate(
- google_url_tracker, search_url))));
+ return static_cast<GoogleURLTrackerInfoBarDelegate*>(
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
+ new GoogleURLTrackerInfoBarDelegate(
+ infobar_service, google_url_tracker, search_url))));
}
bool GoogleURLTrackerInfoBarDelegate::Accept() {
@@ -60,7 +60,7 @@
}
content::WebContents* contents = web_contents();
- infobar()->RemoveSelf();
+ owner()->RemoveInfoBar(this);
// WARNING: |this| may be deleted at this point! Do not access any members!
if (new_search_url.is_valid()) {
@@ -71,9 +71,10 @@
}
GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate(
+ InfoBarService* infobar_service,
GoogleURLTracker* google_url_tracker,
const GURL& search_url)
- : ConfirmInfoBarDelegate(),
+ : ConfirmInfoBarDelegate(infobar_service),
google_url_tracker_(google_url_tracker),
search_url_(search_url),
pending_id_(0) {

Powered by Google App Engine
This is Rietveld 408576698