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

Unified Diff: chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.cc

Issue 2482023002: Put a Settings link on the new Google Search geolocation disclosure. (Closed)
Patch Set: Update comment 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/ui/android/infobars/search_geolocation_disclosure_infobar.cc
diff --git a/chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.cc b/chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.cc
index c8291a58778fea67816c2b185eaf61ad7e639713..a8b01de43879b5e38ac03ac7c6bbd465f25074be 100644
--- a/chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.cc
+++ b/chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.cc
@@ -22,9 +22,24 @@ ScopedJavaLocalRef<jobject>
SearchGeolocationDisclosureInfoBar::CreateRenderInfoBar(JNIEnv* env) {
ScopedJavaLocalRef<jstring> message_text =
base::android::ConvertUTF16ToJavaString(
- env, GetDelegate()->GetMessageText());
+ env, GetDelegate()->message_text());
+ ScopedJavaLocalRef<jstring> search_url =
+ base::android::ConvertUTF8ToJavaString(
+ env, GetDelegate()->search_url().spec());
return Java_SearchGeolocationDisclosureInfoBar_show(
- env, GetEnumeratedIconId(), message_text);
+ env, GetEnumeratedIconId(), message_text,
+ GetDelegate()->inline_link_range().start(),
+ GetDelegate()->inline_link_range().end(),
+ search_url);
+}
+
+void SearchGeolocationDisclosureInfoBar::OnLinkClicked(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj) {
+ if (!owner())
+ return; // We're closing; don't call anything, it might access the owner.
+
+ RemoveSelf();
}
void SearchGeolocationDisclosureInfoBar::ProcessButton(int action) {

Powered by Google App Engine
This is Rietveld 408576698