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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/android/infobars/search_geolocation_disclosure_infob ar.h"
6
7 #include "base/android/jni_string.h"
8 #include "chrome/browser/android/search_geolocation_disclosure_infobar_delegate. h"
9 #include "jni/SearchGeolocationDisclosureInfoBar_jni.h"
10
11 using base::android::JavaParamRef;
12 using base::android::ScopedJavaLocalRef;
13
14 SearchGeolocationDisclosureInfoBar::SearchGeolocationDisclosureInfoBar(
15 std::unique_ptr<SearchGeolocationDisclosureInfoBarDelegate> delegate)
16 : InfoBarAndroid(std::move(delegate)) {}
17
18 SearchGeolocationDisclosureInfoBar::~SearchGeolocationDisclosureInfoBar() {
19 }
20
21 ScopedJavaLocalRef<jobject>
22 SearchGeolocationDisclosureInfoBar::CreateRenderInfoBar(JNIEnv* env) {
23 ScopedJavaLocalRef<jstring> message_text =
24 base::android::ConvertUTF16ToJavaString(
25 env, GetDelegate()->GetMessageText());
26 return Java_SearchGeolocationDisclosureInfoBar_show(
27 env, GetEnumeratedIconId(), message_text);
28 }
29
30 void SearchGeolocationDisclosureInfoBar::ProcessButton(int action) {
31 if (!owner())
32 return; // We're closing; don't call anything, it might access the owner.
33
34 RemoveSelf();
35 }
36
37 SearchGeolocationDisclosureInfoBarDelegate*
38 SearchGeolocationDisclosureInfoBar::GetDelegate() {
39 return static_cast<SearchGeolocationDisclosureInfoBarDelegate*>(delegate());
40 }
OLDNEW
« 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