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

Side by Side Diff: chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.cc

Issue 2534363002: Add infobar metrics for the new search geolocation disclosure. (Closed)
Patch Set: LAST -> COUNT Created 4 years 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/android/infobars/search_geolocation_disclosure_infob ar.h" 5 #include "chrome/browser/ui/android/infobars/search_geolocation_disclosure_infob ar.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "chrome/browser/android/search_geolocation_disclosure_infobar_delegate. h" 8 #include "chrome/browser/android/search_geolocation_disclosure_infobar_delegate. h"
9 #include "jni/SearchGeolocationDisclosureInfoBar_jni.h" 9 #include "jni/SearchGeolocationDisclosureInfoBar_jni.h"
10 10
(...skipping 17 matching lines...) Expand all
28 GetDelegate()->inline_link_range().start(), 28 GetDelegate()->inline_link_range().start(),
29 GetDelegate()->inline_link_range().end()); 29 GetDelegate()->inline_link_range().end());
30 } 30 }
31 31
32 void SearchGeolocationDisclosureInfoBar::OnLinkClicked( 32 void SearchGeolocationDisclosureInfoBar::OnLinkClicked(
33 JNIEnv* env, 33 JNIEnv* env,
34 const base::android::JavaParamRef<jobject>& obj) { 34 const base::android::JavaParamRef<jobject>& obj) {
35 if (!owner()) 35 if (!owner())
36 return; // We're closing; don't call anything, it might access the owner. 36 return; // We're closing; don't call anything, it might access the owner.
37 37
38 // This counts as a dismissed so the dialog isn't shown again. 38 GetDelegate()->RecordSettingsClicked();
39 delegate()->InfoBarDismissed();
40 39
41 ScopedJavaLocalRef<jstring> search_url = 40 ScopedJavaLocalRef<jstring> search_url =
42 base::android::ConvertUTF8ToJavaString( 41 base::android::ConvertUTF8ToJavaString(
43 env, GetDelegate()->search_url().spec()); 42 env, GetDelegate()->search_url().spec());
44 Java_SearchGeolocationDisclosureInfoBar_showSettingsPage(env, search_url); 43 Java_SearchGeolocationDisclosureInfoBar_showSettingsPage(env, search_url);
45 RemoveSelf(); 44 RemoveSelf();
46 } 45 }
47 46
48 void SearchGeolocationDisclosureInfoBar::ProcessButton(int action) { 47 void SearchGeolocationDisclosureInfoBar::ProcessButton(int action) {
49 if (!owner()) 48 if (!owner())
50 return; // We're closing; don't call anything, it might access the owner. 49 return; // We're closing; don't call anything, it might access the owner.
51 50
52 RemoveSelf(); 51 RemoveSelf();
53 } 52 }
54 53
55 SearchGeolocationDisclosureInfoBarDelegate* 54 SearchGeolocationDisclosureInfoBarDelegate*
56 SearchGeolocationDisclosureInfoBar::GetDelegate() { 55 SearchGeolocationDisclosureInfoBar::GetDelegate() {
57 return static_cast<SearchGeolocationDisclosureInfoBarDelegate*>(delegate()); 56 return static_cast<SearchGeolocationDisclosureInfoBarDelegate*>(delegate());
58 } 57 }
OLDNEW
« no previous file with comments | « chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698