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

Side by Side Diff: chrome/browser/android/preferences/pref_service_bridge.cc

Issue 1948633002: Add histograms for notices about other forms of browsing history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android Fix Created 4 years, 7 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/android/preferences/pref_service_bridge.h" 5 #include "chrome/browser/android/preferences/pref_service_bridge.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/android/build_info.h" 13 #include "base/android/build_info.h"
14 #include "base/android/jni_android.h" 14 #include "base/android/jni_android.h"
15 #include "base/android/jni_array.h" 15 #include "base/android/jni_array.h"
16 #include "base/android/jni_string.h" 16 #include "base/android/jni_string.h"
17 #include "base/android/jni_weak_ref.h" 17 #include "base/android/jni_weak_ref.h"
18 #include "base/files/file_path.h" 18 #include "base/files/file_path.h"
19 #include "base/files/file_util.h" 19 #include "base/files/file_util.h"
20 #include "base/metrics/histogram_macros.h"
20 #include "base/scoped_observer.h" 21 #include "base/scoped_observer.h"
21 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
22 #include "base/values.h" 23 #include "base/values.h"
23 #include "chrome/browser/android/preferences/important_sites_util.h" 24 #include "chrome/browser/android/preferences/important_sites_util.h"
24 #include "chrome/browser/browser_process.h" 25 #include "chrome/browser/browser_process.h"
25 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h" 26 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h"
26 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h" 27 #include "chrome/browser/browsing_data/browsing_data_filter_builder.h"
27 #include "chrome/browser/browsing_data/browsing_data_helper.h" 28 #include "chrome/browser/browsing_data/browsing_data_helper.h"
28 #include "chrome/browser/browsing_data/browsing_data_remover.h" 29 #include "chrome/browser/browsing_data/browsing_data_remover.h"
29 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" 30 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 ScopedJavaLocalRef<jobjectArray> string_array = 639 ScopedJavaLocalRef<jobjectArray> string_array =
639 base::android::ToJavaArrayOfStrings(env, important_domains); 640 base::android::ToJavaArrayOfStrings(env, important_domains);
640 Java_ImportantSitesCallback_onImportantRegisterableDomainsReady( 641 Java_ImportantSitesCallback_onImportantRegisterableDomainsReady(
641 env, java_callback.obj(), string_array.obj()); 642 env, java_callback.obj(), string_array.obj());
642 } 643 }
643 644
644 static void ShowNoticeAboutOtherFormsOfBrowsingHistory( 645 static void ShowNoticeAboutOtherFormsOfBrowsingHistory(
645 ScopedJavaGlobalRef<jobject>* listener, 646 ScopedJavaGlobalRef<jobject>* listener,
646 bool show) { 647 bool show) {
647 JNIEnv* env = AttachCurrentThread(); 648 JNIEnv* env = AttachCurrentThread();
649 UMA_HISTOGRAM_BOOLEAN(
650 "History.ClearBrowsingData.HistoryNoticeShownInFooterWhenUpdated", show);
648 if (!show) 651 if (!show)
649 return; 652 return;
650 Java_OtherFormsOfBrowsingHistoryListener_showNoticeAboutOtherFormsOfBrowsingHi story( 653 Java_OtherFormsOfBrowsingHistoryListener_showNoticeAboutOtherFormsOfBrowsingHi story(
651 env, listener->obj()); 654 env, listener->obj());
652 } 655 }
653 656
654 static void EnableDialogAboutOtherFormsOfBrowsingHistory( 657 static void EnableDialogAboutOtherFormsOfBrowsingHistory(
655 ScopedJavaGlobalRef<jobject>* listener, 658 ScopedJavaGlobalRef<jobject>* listener,
656 bool enabled) { 659 bool enabled) {
657 JNIEnv* env = AttachCurrentThread(); 660 JNIEnv* env = AttachCurrentThread();
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1109
1107 return ConvertJavaStringToUTF8(android_permission); 1110 return ConvertJavaStringToUTF8(android_permission);
1108 } 1111 }
1109 1112
1110 static void SetSupervisedUserId(JNIEnv* env, 1113 static void SetSupervisedUserId(JNIEnv* env,
1111 const JavaParamRef<jobject>& obj, 1114 const JavaParamRef<jobject>& obj,
1112 const JavaParamRef<jstring>& pref) { 1115 const JavaParamRef<jstring>& pref) {
1113 GetPrefService()->SetString(prefs::kSupervisedUserId, 1116 GetPrefService()->SetString(prefs::kSupervisedUserId,
1114 ConvertJavaStringToUTF8(env, pref)); 1117 ConvertJavaStringToUTF8(env, pref));
1115 } 1118 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698