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

Unified Diff: chrome/browser/google/google_url_tracker_infobar_delegate.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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/google/google_url_tracker_infobar_delegate.cc
===================================================================
--- chrome/browser/google/google_url_tracker_infobar_delegate.cc (revision 175396)
+++ chrome/browser/google/google_url_tracker_infobar_delegate.cc (working copy)
@@ -16,14 +16,15 @@
#include "ui/base/l10n/l10n_util.h"
-GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate(
+// static
+GoogleURLTrackerInfoBarDelegate* GoogleURLTrackerInfoBarDelegate::Create(
InfoBarService* infobar_service,
GoogleURLTracker* google_url_tracker,
- const GURL& search_url)
- : ConfirmInfoBarDelegate(infobar_service),
- google_url_tracker_(google_url_tracker),
- search_url_(search_url),
- pending_id_(0) {
+ const GURL& search_url) {
+ return static_cast<GoogleURLTrackerInfoBarDelegate*>(
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
+ new GoogleURLTrackerInfoBarDelegate(
+ infobar_service, google_url_tracker, search_url))));
}
bool GoogleURLTrackerInfoBarDelegate::Accept() {
@@ -81,6 +82,16 @@
owner()->RemoveInfoBar(this);
}
+GoogleURLTrackerInfoBarDelegate::GoogleURLTrackerInfoBarDelegate(
+ InfoBarService* infobar_service,
+ GoogleURLTracker* google_url_tracker,
+ const GURL& search_url)
+ : ConfirmInfoBarDelegate(infobar_service),
+ google_url_tracker_(google_url_tracker),
+ search_url_(search_url),
+ pending_id_(0) {
+}
+
GoogleURLTrackerInfoBarDelegate::~GoogleURLTrackerInfoBarDelegate() {
}
« no previous file with comments | « chrome/browser/google/google_url_tracker_infobar_delegate.h ('k') | chrome/browser/google/google_url_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698