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 <utility> |
8 | 9 |
9 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
10 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
11 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/character_encoding.h" | 14 #include "chrome/browser/character_encoding.h" |
14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/webui/options/font_settings_utils.h" | 16 #include "chrome/browser/ui/webui/options/font_settings_utils.h" |
16 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
17 #include "content/public/browser/font_list_async.h" | 18 #include "content/public/browser/font_list_async.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 it.encoding_id)); | 74 it.encoding_id)); |
74 option->AppendString(it.encoding_display_name); | 75 option->AppendString(it.encoding_display_name); |
75 option->AppendString( | 76 option->AppendString( |
76 base::i18n::StringContainsStrongRTLChars(it.encoding_display_name) | 77 base::i18n::StringContainsStrongRTLChars(it.encoding_display_name) |
77 ? "rtl" | 78 ? "rtl" |
78 : "ltr"); | 79 : "ltr"); |
79 } else { | 80 } else { |
80 // Add empty value to indicate a separator item. | 81 // Add empty value to indicate a separator item. |
81 option->AppendString(std::string()); | 82 option->AppendString(std::string()); |
82 } | 83 } |
83 encoding_list.Append(option.Pass()); | 84 encoding_list.Append(std::move(option)); |
84 } | 85 } |
85 | 86 |
86 web_ui()->CallJavascriptFunction("Settings.setFontsData", *list, | 87 web_ui()->CallJavascriptFunction("Settings.setFontsData", *list, |
87 encoding_list); | 88 encoding_list); |
88 } | 89 } |
89 | 90 |
90 } // namespace settings | 91 } // namespace settings |
OLD | NEW |