| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 SetUpStandardFontSample(); | 167 SetUpStandardFontSample(); |
| 168 SetUpSerifFontSample(); | 168 SetUpSerifFontSample(); |
| 169 SetUpSansSerifFontSample(); | 169 SetUpSansSerifFontSample(); |
| 170 } else if (*pref_name == prefs::kWebKitMinimumFontSize) { | 170 } else if (*pref_name == prefs::kWebKitMinimumFontSize) { |
| 171 SetUpMinimumFontSample(); | 171 SetUpMinimumFontSample(); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 void FontSettingsHandler::SetUpStandardFontSample() { | 176 void FontSettingsHandler::SetUpStandardFontSample() { |
| 177 StringValue font_value(standard_font_.GetValue()); | 177 base::StringValue font_value(standard_font_.GetValue()); |
| 178 FundamentalValue size_value(default_font_size_.GetValue()); | 178 base::FundamentalValue size_value(default_font_size_.GetValue()); |
| 179 web_ui_->CallJavascriptFunction( | 179 web_ui_->CallJavascriptFunction( |
| 180 "FontSettings.setUpStandardFontSample", font_value, size_value); | 180 "FontSettings.setUpStandardFontSample", font_value, size_value); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void FontSettingsHandler::SetUpSerifFontSample() { | 183 void FontSettingsHandler::SetUpSerifFontSample() { |
| 184 StringValue font_value(serif_font_.GetValue()); | 184 base::StringValue font_value(serif_font_.GetValue()); |
| 185 FundamentalValue size_value(default_font_size_.GetValue()); | 185 base::FundamentalValue size_value(default_font_size_.GetValue()); |
| 186 web_ui_->CallJavascriptFunction( | 186 web_ui_->CallJavascriptFunction( |
| 187 "FontSettings.setUpSerifFontSample", font_value, size_value); | 187 "FontSettings.setUpSerifFontSample", font_value, size_value); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void FontSettingsHandler::SetUpSansSerifFontSample() { | 190 void FontSettingsHandler::SetUpSansSerifFontSample() { |
| 191 StringValue font_value(sans_serif_font_.GetValue()); | 191 base::StringValue font_value(sans_serif_font_.GetValue()); |
| 192 FundamentalValue size_value(default_font_size_.GetValue()); | 192 base::FundamentalValue size_value(default_font_size_.GetValue()); |
| 193 web_ui_->CallJavascriptFunction( | 193 web_ui_->CallJavascriptFunction( |
| 194 "FontSettings.setUpSansSerifFontSample", font_value, size_value); | 194 "FontSettings.setUpSansSerifFontSample", font_value, size_value); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void FontSettingsHandler::SetUpFixedFontSample() { | 197 void FontSettingsHandler::SetUpFixedFontSample() { |
| 198 StringValue font_value(fixed_font_.GetValue()); | 198 base::StringValue font_value(fixed_font_.GetValue()); |
| 199 FundamentalValue size_value(default_fixed_font_size_.GetValue()); | 199 base::FundamentalValue size_value(default_fixed_font_size_.GetValue()); |
| 200 web_ui_->CallJavascriptFunction( | 200 web_ui_->CallJavascriptFunction( |
| 201 "FontSettings.setUpFixedFontSample", font_value, size_value); | 201 "FontSettings.setUpFixedFontSample", font_value, size_value); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void FontSettingsHandler::SetUpMinimumFontSample() { | 204 void FontSettingsHandler::SetUpMinimumFontSample() { |
| 205 FundamentalValue size_value(minimum_font_size_.GetValue()); | 205 base::FundamentalValue size_value(minimum_font_size_.GetValue()); |
| 206 web_ui_->CallJavascriptFunction("FontSettings.setUpMinimumFontSample", | 206 web_ui_->CallJavascriptFunction("FontSettings.setUpMinimumFontSample", |
| 207 size_value); | 207 size_value); |
| 208 } | 208 } |
| OLD | NEW |