| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/font_handler.h" | 5 #include "chrome/browser/ui/webui/settings/font_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 for (size_t i = 0; i < list->GetSize(); i++) { | 127 for (size_t i = 0; i < list->GetSize(); i++) { |
| 128 base::ListValue* font; | 128 base::ListValue* font; |
| 129 bool has_font = list->GetList(i, &font); | 129 bool has_font = list->GetList(i, &font); |
| 130 DCHECK(has_font); | 130 DCHECK(has_font); |
| 131 | 131 |
| 132 base::string16 value; | 132 base::string16 value; |
| 133 bool has_value = font->GetString(1, &value); | 133 bool has_value = font->GetString(1, &value); |
| 134 DCHECK(has_value); | 134 DCHECK(has_value); |
| 135 | 135 |
| 136 bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(value); | 136 bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(value); |
| 137 font->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr")); | 137 font->AppendString(has_rtl_chars ? "rtl" : "ltr"); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Character encoding list. | 140 // Character encoding list. |
| 141 const std::vector<CharacterEncoding::EncodingInfo>* encodings; | 141 const std::vector<CharacterEncoding::EncodingInfo>* encodings; |
| 142 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 142 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 143 encodings = CharacterEncoding::GetCurrentDisplayEncodings( | 143 encodings = CharacterEncoding::GetCurrentDisplayEncodings( |
| 144 g_browser_process->GetApplicationLocale(), | 144 g_browser_process->GetApplicationLocale(), |
| 145 pref_service->GetString(prefs::kStaticEncodings), | 145 pref_service->GetString(prefs::kStaticEncodings), |
| 146 pref_service->GetString(prefs::kRecentlySelectedEncoding)); | 146 pref_service->GetString(prefs::kRecentlySelectedEncoding)); |
| 147 DCHECK(!encodings->empty()); | 147 DCHECK(!encodings->empty()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 171 | 171 |
| 172 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix()); | 172 GURL extension_url(extension_urls::GetWebstoreItemDetailURLPrefix()); |
| 173 response.SetString( | 173 response.SetString( |
| 174 "extensionUrl", | 174 "extensionUrl", |
| 175 extension_url.Resolve(kAdvancedFontSettingsExtensionId).spec()); | 175 extension_url.Resolve(kAdvancedFontSettingsExtensionId).spec()); |
| 176 | 176 |
| 177 ResolveJavascriptCallback(base::StringValue(callback_id), response); | 177 ResolveJavascriptCallback(base::StringValue(callback_id), response); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace settings | 180 } // namespace settings |
| OLD | NEW |