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

Unified Diff: chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc

Issue 2482023002: Put a Settings link on the new Google Search geolocation disclosure. (Closed)
Patch Set: Feedback Created 4 years, 1 month 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/android/search_geolocation_disclosure_infobar_delegate.cc
diff --git a/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc b/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc
index 34e0f2a6587a26db383e48bdbe66918c3f389ae2..457fd9e477577d4b567a29daaaf42a7351e67132 100644
--- a/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc
+++ b/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc
@@ -17,24 +17,26 @@ SearchGeolocationDisclosureInfoBarDelegate::
// static
void SearchGeolocationDisclosureInfoBarDelegate::Create(
- content::WebContents* web_contents) {
+ content::WebContents* web_contents, const GURL& search_url) {
InfoBarService* infobar_service =
InfoBarService::FromWebContents(web_contents);
// Add the new delegate.
infobar_service->AddInfoBar(
- base::MakeUnique<SearchGeolocationDisclosureInfoBar>(
- base::WrapUnique(new SearchGeolocationDisclosureInfoBarDelegate())));
+ base::MakeUnique<SearchGeolocationDisclosureInfoBar>(base::WrapUnique(
+ new SearchGeolocationDisclosureInfoBarDelegate(search_url))));
}
-base::string16 SearchGeolocationDisclosureInfoBarDelegate::GetMessageText()
- const {
- return l10n_util::GetStringUTF16(
- IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_TEXT);
-};
-
SearchGeolocationDisclosureInfoBarDelegate::
- SearchGeolocationDisclosureInfoBarDelegate()
- : infobars::InfoBarDelegate() {}
+ SearchGeolocationDisclosureInfoBarDelegate(const GURL& search_url)
+ : infobars::InfoBarDelegate(),
+ search_url_(search_url) {
+ base::string16 link = l10n_util::GetStringUTF16(
+ IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_SETTINGS_LINK_TEXT);
+ size_t offset;
+ message_text_ = l10n_util::GetStringFUTF16(
+ IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_TEXT, link, &offset);
+ inline_link_range_ = gfx::Range(offset, offset + link.length());
+}
infobars::InfoBarDelegate::Type
SearchGeolocationDisclosureInfoBarDelegate::GetInfoBarType() const {

Powered by Google App Engine
This is Rietveld 408576698