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

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

Issue 2475213002: Update the Google Search geolocation disclosure to make it more obvious. (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/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
new file mode 100644
index 0000000000000000000000000000000000000000..c8291a58778fea67816c2b185eaf61ad7e639713
--- /dev/null
+++ b/chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.cc
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.h"
+
+#include "base/android/jni_string.h"
+#include "chrome/browser/android/search_geolocation_disclosure_infobar_delegate.h"
+#include "jni/SearchGeolocationDisclosureInfoBar_jni.h"
+
+using base::android::JavaParamRef;
+using base::android::ScopedJavaLocalRef;
+
+SearchGeolocationDisclosureInfoBar::SearchGeolocationDisclosureInfoBar(
+ std::unique_ptr<SearchGeolocationDisclosureInfoBarDelegate> delegate)
+ : InfoBarAndroid(std::move(delegate)) {}
+
+SearchGeolocationDisclosureInfoBar::~SearchGeolocationDisclosureInfoBar() {
+}
+
+ScopedJavaLocalRef<jobject>
+SearchGeolocationDisclosureInfoBar::CreateRenderInfoBar(JNIEnv* env) {
+ ScopedJavaLocalRef<jstring> message_text =
+ base::android::ConvertUTF16ToJavaString(
+ env, GetDelegate()->GetMessageText());
+ return Java_SearchGeolocationDisclosureInfoBar_show(
+ env, GetEnumeratedIconId(), message_text);
+}
+
+void SearchGeolocationDisclosureInfoBar::ProcessButton(int action) {
+ if (!owner())
+ return; // We're closing; don't call anything, it might access the owner.
+
+ RemoveSelf();
+}
+
+SearchGeolocationDisclosureInfoBarDelegate*
+SearchGeolocationDisclosureInfoBar::GetDelegate() {
+ return static_cast<SearchGeolocationDisclosureInfoBarDelegate*>(delegate());
+}
« no previous file with comments | « chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.h ('k') | chrome/browser/ui/tab_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698