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

Unified Diff: chrome/browser/geolocation/geolocation_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/geolocation/geolocation_infobar_delegate.cc
diff --git a/chrome/browser/geolocation/geolocation_infobar_delegate.cc b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
index d910433285e70098baaa6b28145ab1ca547effbc..95d6b25b19ae399896781459529610728d68dd63 100644
--- a/chrome/browser/geolocation/geolocation_infobar_delegate.cc
+++ b/chrome/browser/geolocation/geolocation_infobar_delegate.cc
@@ -113,9 +113,11 @@ bool GeolocationInfoBarDelegate::Accept() {
void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting,
bool allowed) {
+ content::WebContents* web_contents =
+ InfoBarService::WebContentsFromInfoBar(infobar());
controller_->OnPermissionSet(
id_, requesting_frame_,
- web_contents()->GetLastCommittedURL().GetOrigin(),
+ web_contents->GetLastCommittedURL().GetOrigin(),
update_content_setting, allowed);
}
@@ -175,10 +177,11 @@ bool GeolocationInfoBarDelegate::LinkClicked(
"https://www.google.com/support/chrome/bin/answer.py?answer=142065";
#endif
- web_contents()->OpenURL(content::OpenURLParams(
- google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)),
- content::Referrer(),
- (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
- content::PAGE_TRANSITION_LINK, false));
+ InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
+ content::OpenURLParams(
+ google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)),
+ content::Referrer(),
+ (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
+ content::PAGE_TRANSITION_LINK, false));
return false; // Do not dismiss the info bar.
}
« no previous file with comments | « chrome/browser/extensions/extension_infobar_delegate.cc ('k') | chrome/browser/google/google_url_tracker_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698