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

Side by Side Diff: chrome/browser/android/accessibility/font_size_prefs_android.cc

Issue 563743002: Remove FontSizePrefs destroy() method as its a singleton class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes Incorporated Created 6 years, 3 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
« no previous file with comments | « chrome/browser/android/accessibility/font_size_prefs_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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" 8 #include "base/prefs/pref_change_registrar.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile_android.h" 10 #include "chrome/browser/profiles/profile_android.h"
(...skipping 12 matching lines...) Expand all
23 base::Unretained(this))); 23 base::Unretained(this)));
24 pref_change_registrar_->Add( 24 pref_change_registrar_->Add(
25 prefs::kWebKitForceEnableZoom, 25 prefs::kWebKitForceEnableZoom,
26 base::Bind(&FontSizePrefsAndroid::OnForceEnableZoomPrefsChanged, 26 base::Bind(&FontSizePrefsAndroid::OnForceEnableZoomPrefsChanged,
27 base::Unretained(this))); 27 base::Unretained(this)));
28 } 28 }
29 29
30 FontSizePrefsAndroid::~FontSizePrefsAndroid() { 30 FontSizePrefsAndroid::~FontSizePrefsAndroid() {
31 } 31 }
32 32
33 void FontSizePrefsAndroid::Destroy(JNIEnv* env, jobject obj) {
34 delete this;
35 }
36
37 void FontSizePrefsAndroid::SetFontScaleFactor(JNIEnv* env, 33 void FontSizePrefsAndroid::SetFontScaleFactor(JNIEnv* env,
38 jobject obj, 34 jobject obj,
39 jfloat font_size) { 35 jfloat font_size) {
40 pref_service_->SetDouble(prefs::kWebKitFontScaleFactor, 36 pref_service_->SetDouble(prefs::kWebKitFontScaleFactor,
41 static_cast<double>(font_size)); 37 static_cast<double>(font_size));
42 } 38 }
43 39
44 float FontSizePrefsAndroid::GetFontScaleFactor(JNIEnv* env, jobject obj) { 40 float FontSizePrefsAndroid::GetFontScaleFactor(JNIEnv* env, jobject obj) {
45 return pref_service_->GetDouble(prefs::kWebKitFontScaleFactor); 41 return pref_service_->GetDouble(prefs::kWebKitFontScaleFactor);
46 } 42 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 JNIEnv* env = base::android::AttachCurrentThread(); 119 JNIEnv* env = base::android::AttachCurrentThread();
124 Java_FontSizePrefsObserverWrapper_onChangeFontSize( 120 Java_FontSizePrefsObserverWrapper_onChangeFontSize(
125 env, java_ref_.obj(), font_size); 121 env, java_ref_.obj(), font_size);
126 } 122 }
127 123
128 void FontSizePrefsObserverAndroid::OnChangeForceEnableZoom(bool enabled) { 124 void FontSizePrefsObserverAndroid::OnChangeForceEnableZoom(bool enabled) {
129 JNIEnv* env = base::android::AttachCurrentThread(); 125 JNIEnv* env = base::android::AttachCurrentThread();
130 Java_FontSizePrefsObserverWrapper_onChangeForceEnableZoom( 126 Java_FontSizePrefsObserverWrapper_onChangeForceEnableZoom(
131 env, java_ref_.obj(), enabled); 127 env, java_ref_.obj(), enabled);
132 } 128 }
OLDNEW
« no previous file with comments | « chrome/browser/android/accessibility/font_size_prefs_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698