| OLD | NEW |
| 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/accessibility/font_size_prefs_android.h" | 5 #include "chrome/browser/android/accessibility/font_size_prefs_android.h" |
| 6 | 6 |
| 7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
| 8 #include "base/prefs/pref_change_registrar.h" | |
| 9 #include "base/prefs/pref_service.h" | |
| 10 #include "chrome/browser/profiles/profile_android.h" | 8 #include "chrome/browser/profiles/profile_android.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 #include "components/prefs/pref_change_registrar.h" |
| 12 #include "components/prefs/pref_service.h" |
| 13 #include "jni/FontSizePrefs_jni.h" | 13 #include "jni/FontSizePrefs_jni.h" |
| 14 | 14 |
| 15 using base::android::JavaRef; | 15 using base::android::JavaRef; |
| 16 | 16 |
| 17 FontSizePrefsAndroid::FontSizePrefsAndroid(JNIEnv* env, jobject obj) | 17 FontSizePrefsAndroid::FontSizePrefsAndroid(JNIEnv* env, jobject obj) |
| 18 : pref_service_(ProfileManager::GetActiveUserProfile()->GetPrefs()) { | 18 : pref_service_(ProfileManager::GetActiveUserProfile()->GetPrefs()) { |
| 19 java_ref_.Reset(env, obj); | 19 java_ref_.Reset(env, obj); |
| 20 pref_change_registrar_.reset(new PrefChangeRegistrar); | 20 pref_change_registrar_.reset(new PrefChangeRegistrar); |
| 21 pref_change_registrar_->Init(pref_service_); | 21 pref_change_registrar_->Init(pref_service_); |
| 22 pref_change_registrar_->Add( | 22 pref_change_registrar_->Add( |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 JNIEnv* env = base::android::AttachCurrentThread(); | 126 JNIEnv* env = base::android::AttachCurrentThread(); |
| 127 Java_FontSizePrefsObserverWrapper_onChangeFontSize( | 127 Java_FontSizePrefsObserverWrapper_onChangeFontSize( |
| 128 env, java_ref_.obj(), font_size); | 128 env, java_ref_.obj(), font_size); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void FontSizePrefsObserverAndroid::OnChangeForceEnableZoom(bool enabled) { | 131 void FontSizePrefsObserverAndroid::OnChangeForceEnableZoom(bool enabled) { |
| 132 JNIEnv* env = base::android::AttachCurrentThread(); | 132 JNIEnv* env = base::android::AttachCurrentThread(); |
| 133 Java_FontSizePrefsObserverWrapper_onChangeForceEnableZoom( | 133 Java_FontSizePrefsObserverWrapper_onChangeForceEnableZoom( |
| 134 env, java_ref_.obj(), enabled); | 134 env, java_ref_.obj(), enabled); |
| 135 } | 135 } |
| OLD | NEW |