OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/new_tab_page_prefs.h" | 5 #include "chrome/browser/android/new_tab_page_prefs.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 | 8 |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 : profile_(profile) { | 26 : profile_(profile) { |
27 } | 27 } |
28 | 28 |
29 void NewTabPagePrefs::Destroy(JNIEnv* env, jobject obj) { | 29 void NewTabPagePrefs::Destroy(JNIEnv* env, jobject obj) { |
30 delete this; | 30 delete this; |
31 } | 31 } |
32 | 32 |
33 NewTabPagePrefs::~NewTabPagePrefs() { | 33 NewTabPagePrefs::~NewTabPagePrefs() { |
34 } | 34 } |
35 | 35 |
| 36 jboolean NewTabPagePrefs::GetCurrentlyOpenTabsCollapsed(JNIEnv* env, |
| 37 jobject obj) { |
| 38 PrefService* prefs = profile_->GetPrefs(); |
| 39 return prefs->GetBoolean(prefs::kNtpCollapsedCurrentlyOpenTabs); |
| 40 } |
| 41 |
| 42 void NewTabPagePrefs::SetCurrentlyOpenTabsCollapsed(JNIEnv* env, |
| 43 jobject obj, |
| 44 jboolean is_collapsed) { |
| 45 PrefService* prefs = profile_->GetPrefs(); |
| 46 prefs->SetBoolean(prefs::kNtpCollapsedCurrentlyOpenTabs, is_collapsed); |
| 47 } |
| 48 |
36 jboolean NewTabPagePrefs::GetSnapshotDocumentCollapsed(JNIEnv* env, | 49 jboolean NewTabPagePrefs::GetSnapshotDocumentCollapsed(JNIEnv* env, |
37 jobject obj) { | 50 jobject obj) { |
38 return profile_->GetPrefs()->GetBoolean(prefs::kNtpCollapsedSnapshotDocument); | 51 return profile_->GetPrefs()->GetBoolean(prefs::kNtpCollapsedSnapshotDocument); |
39 } | 52 } |
40 | 53 |
41 void NewTabPagePrefs::SetSnapshotDocumentCollapsed(JNIEnv* env, | 54 void NewTabPagePrefs::SetSnapshotDocumentCollapsed(JNIEnv* env, |
42 jobject obj, | 55 jobject obj, |
43 jboolean is_collapsed) { | 56 jboolean is_collapsed) { |
44 PrefService* prefs = profile_->GetPrefs(); | 57 PrefService* prefs = profile_->GetPrefs(); |
45 prefs->SetBoolean(prefs::kNtpCollapsedSnapshotDocument, is_collapsed); | 58 prefs->SetBoolean(prefs::kNtpCollapsedSnapshotDocument, is_collapsed); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 125 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
113 registry->RegisterDictionaryPref( | 126 registry->RegisterDictionaryPref( |
114 prefs::kNtpMostVisitedURLsBlacklist, | 127 prefs::kNtpMostVisitedURLsBlacklist, |
115 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 128 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
116 } | 129 } |
117 | 130 |
118 // static | 131 // static |
119 bool NewTabPagePrefs::RegisterNewTabPagePrefs(JNIEnv* env) { | 132 bool NewTabPagePrefs::RegisterNewTabPagePrefs(JNIEnv* env) { |
120 return RegisterNativesImpl(env); | 133 return RegisterNativesImpl(env); |
121 } | 134 } |
OLD | NEW |