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

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

Issue 2927063002: Add metrics for new CBD dialog (Closed)
Patch Set: Update migration comment (and rebase) Created 3 years, 6 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>
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 ToTabEnum(clear_browsing_data_tab))); 543 ToTabEnum(clear_browsing_data_tab)));
544 } 544 }
545 545
546 static void SetBrowsingDataDeletionTimePeriod(JNIEnv* env, 546 static void SetBrowsingDataDeletionTimePeriod(JNIEnv* env,
547 const JavaParamRef<jobject>& obj, 547 const JavaParamRef<jobject>& obj,
548 jint clear_browsing_data_tab, 548 jint clear_browsing_data_tab,
549 jint time_period) { 549 jint time_period) {
550 DCHECK_GE(time_period, 0); 550 DCHECK_GE(time_period, 0);
551 DCHECK_LE(time_period, 551 DCHECK_LE(time_period,
552 static_cast<int>(browsing_data::TimePeriod::TIME_PERIOD_LAST)); 552 static_cast<int>(browsing_data::TimePeriod::TIME_PERIOD_LAST));
553 browsing_data::RecordTimePeriodChange(
554 static_cast<browsing_data::TimePeriod>(time_period));
553 GetPrefService()->SetInteger(browsing_data::GetTimePeriodPreferenceName( 555 GetPrefService()->SetInteger(browsing_data::GetTimePeriodPreferenceName(
554 ToTabEnum(clear_browsing_data_tab)), 556 ToTabEnum(clear_browsing_data_tab)),
555 time_period); 557 time_period);
556 } 558 }
557 559
558 static jint GetLastClearBrowsingDataTab(JNIEnv* env, 560 static jint GetLastClearBrowsingDataTab(JNIEnv* env,
559 const JavaParamRef<jobject>& obj) { 561 const JavaParamRef<jobject>& obj) {
560 return GetPrefService()->GetInteger( 562 return GetPrefService()->GetInteger(
561 browsing_data::prefs::kLastClearBrowsingDataTab); 563 browsing_data::prefs::kLastClearBrowsingDataTab);
562 } 564 }
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 .obj(), 1013 .obj(),
1012 out); 1014 out);
1013 } 1015 }
1014 1016
1015 static void SetSupervisedUserId(JNIEnv* env, 1017 static void SetSupervisedUserId(JNIEnv* env,
1016 const JavaParamRef<jobject>& obj, 1018 const JavaParamRef<jobject>& obj,
1017 const JavaParamRef<jstring>& pref) { 1019 const JavaParamRef<jstring>& pref) {
1018 GetPrefService()->SetString(prefs::kSupervisedUserId, 1020 GetPrefService()->SetString(prefs::kSupervisedUserId,
1019 ConvertJavaStringToUTF8(env, pref)); 1021 ConvertJavaStringToUTF8(env, pref));
1020 } 1022 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698