| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 int cmd_id = it->encoding_id; | 181 int cmd_id = it->encoding_id; |
| 182 std::string encoding = | 182 std::string encoding = |
| 183 CharacterEncoding::GetCanonicalEncodingNameByCommandId(cmd_id); | 183 CharacterEncoding::GetCanonicalEncodingNameByCommandId(cmd_id); |
| 184 string16 name = it->encoding_display_name; | 184 string16 name = it->encoding_display_name; |
| 185 bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(name); | 185 bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(name); |
| 186 option->Append(new base::StringValue(encoding)); | 186 option->Append(new base::StringValue(encoding)); |
| 187 option->Append(new base::StringValue(name)); | 187 option->Append(new base::StringValue(name)); |
| 188 option->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr")); | 188 option->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr")); |
| 189 } else { | 189 } else { |
| 190 // Add empty name/value to indicate a separator item. | 190 // Add empty name/value to indicate a separator item. |
| 191 option->Append(new base::StringValue("")); | 191 option->Append(new base::StringValue(std::string())); |
| 192 option->Append(new base::StringValue("")); | 192 option->Append(new base::StringValue(std::string())); |
| 193 } | 193 } |
| 194 encoding_list.Append(option); | 194 encoding_list.Append(option); |
| 195 } | 195 } |
| 196 | 196 |
| 197 ListValue selected_values; | 197 ListValue selected_values; |
| 198 selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName( | 198 selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName( |
| 199 standard_font_.GetValue()))); | 199 standard_font_.GetValue()))); |
| 200 selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName( | 200 selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName( |
| 201 serif_font_.GetValue()))); | 201 serif_font_.GetValue()))); |
| 202 selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName( | 202 selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName( |
| (...skipping 41 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 |