| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/options/font_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/font_settings_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 SetUpFixedFontSample(); | 99 SetUpFixedFontSample(); |
| 100 SetUpMinimumFontSample(); | 100 SetUpMinimumFontSample(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void FontSettingsHandler::RegisterMessages() { | 103 void FontSettingsHandler::RegisterMessages() { |
| 104 // Perform validation for saved fonts. | 104 // Perform validation for saved fonts. |
| 105 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 105 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 106 FontSettingsUtilities::ValidateSavedFonts(pref_service); | 106 FontSettingsUtilities::ValidateSavedFonts(pref_service); |
| 107 | 107 |
| 108 // Register for preferences that we need to observe manually. | 108 // Register for preferences that we need to observe manually. |
| 109 font_encoding_.Init(prefs::kDefaultCharset, pref_service, NULL); | 109 font_encoding_.Init(prefs::kDefaultCharset, pref_service); |
| 110 | 110 |
| 111 standard_font_.Init(prefs::kWebKitStandardFontFamily, | 111 standard_font_.Init(prefs::kWebKitStandardFontFamily, |
| 112 pref_service, | 112 pref_service, |
| 113 base::Bind(&FontSettingsHandler::SetUpStandardFontSample, | 113 base::Bind(&FontSettingsHandler::SetUpStandardFontSample, |
| 114 base::Unretained(this))); | 114 base::Unretained(this))); |
| 115 serif_font_.Init(prefs::kWebKitSerifFontFamily, | 115 serif_font_.Init(prefs::kWebKitSerifFontFamily, |
| 116 pref_service, | 116 pref_service, |
| 117 base::Bind(&FontSettingsHandler::SetUpSerifFontSample, | 117 base::Bind(&FontSettingsHandler::SetUpSerifFontSample, |
| 118 base::Unretained(this))); | 118 base::Unretained(this))); |
| 119 sans_serif_font_.Init( | 119 sans_serif_font_.Init( |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 size_value); | 244 size_value); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void FontSettingsHandler::OnWebKitDefaultFontSizeChanged() { | 247 void FontSettingsHandler::OnWebKitDefaultFontSizeChanged() { |
| 248 SetUpStandardFontSample(); | 248 SetUpStandardFontSample(); |
| 249 SetUpSerifFontSample(); | 249 SetUpSerifFontSample(); |
| 250 SetUpSansSerifFontSample(); | 250 SetUpSansSerifFontSample(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 } // namespace options | 253 } // namespace options |
| OLD | NEW |