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

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

Issue 230453004: Remove InfoBarDelegate::web_contents() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile Created 6 years, 8 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
diff --git a/chrome/browser/google/google_url_tracker_infobar_delegate.cc b/chrome/browser/google/google_url_tracker_infobar_delegate.cc
index 488afa6721a39b20091e8c0f2ff1ceed79be5683..0d31f1e9ee89ba67f54187c1d9a3185fd6889b01 100644
--- a/chrome/browser/google/google_url_tracker_infobar_delegate.cc
+++ b/chrome/browser/google/google_url_tracker_infobar_delegate.cc
@@ -58,7 +58,8 @@ void GoogleURLTrackerInfoBarDelegate::Close(bool redo_search) {
new_search_url = search_url_.ReplaceComponents(replacements);
}
- content::WebContents* contents = web_contents();
+ content::WebContents* contents =
+ InfoBarService::WebContentsFromInfoBar(infobar());
infobar()->RemoveSelf();
// WARNING: |this| may be deleted at this point! Do not access any members!
@@ -106,13 +107,14 @@ base::string16 GoogleURLTrackerInfoBarDelegate::GetLinkText() const {
bool GoogleURLTrackerInfoBarDelegate::LinkClicked(
WindowOpenDisposition disposition) {
- web_contents()->OpenURL(content::OpenURLParams(
- google_util::AppendGoogleLocaleParam(GURL(
- "https://www.google.com/support/chrome/bin/answer.py?"
- "answer=1618699")),
- content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK, false));
+ InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
+ content::OpenURLParams(
+ google_util::AppendGoogleLocaleParam(GURL(
+ "https://www.google.com/support/chrome/bin/answer.py?"
+ "answer=1618699")),
+ content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false));
return false;
}
« no previous file with comments | « chrome/browser/geolocation/geolocation_infobar_delegate.cc ('k') | chrome/browser/infobars/infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698