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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ |
7 | 7 |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | 8 #include "base/macros.h" |
11 #include "chrome/browser/ui/webui/options/language_options_handler_common.h" | 9 #include "chrome/browser/ui/webui/options/language_options_handler_common.h" |
12 | 10 |
13 namespace base { | |
14 class ListValue; | |
15 } | |
16 | |
17 namespace options { | 11 namespace options { |
18 | 12 |
19 // Language options UI page handler for non-Chrome OS platforms. For Chrome OS, | 13 // Language options UI page handler for non-Chrome OS platforms. For Chrome OS, |
20 // see chromeos::CrosLanguageOptionsHandler. | 14 // see chromeos::CrosLanguageOptionsHandler. |
21 class LanguageOptionsHandler : public LanguageOptionsHandlerCommon { | 15 class LanguageOptionsHandler : public LanguageOptionsHandlerCommon { |
22 public: | 16 public: |
23 LanguageOptionsHandler(); | 17 LanguageOptionsHandler(); |
24 ~LanguageOptionsHandler() override; | 18 ~LanguageOptionsHandler() override; |
25 | 19 |
26 // OptionsPageUIHandler implementation. | 20 // OptionsPageUIHandler implementation. |
27 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; | 21 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
28 | 22 |
29 // WebUIMessageHandler implementation. | 23 // WebUIMessageHandler implementation. |
30 void RegisterMessages() override; | 24 void RegisterMessages() override; |
31 | 25 |
32 // The following static method is public for ease of testing. | 26 // The following static method is public for ease of testing. |
33 | 27 |
34 // Gets the list of languages from the given input descriptors. | 28 // Gets the list of languages from the given input descriptors. |
35 // The return value will look like: | 29 // The return value will look like: |
36 // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, | 30 // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, |
37 // ...] | 31 // ...] |
38 static std::unique_ptr<base::ListValue> GetLanguageList(); | 32 static base::ListValue* GetLanguageList(); |
39 | 33 |
40 private: | 34 private: |
41 // LanguageOptionsHandlerCommon implementation. | 35 // LanguageOptionsHandlerCommon implementation. |
42 void SetApplicationLocale(const std::string& language_code) override; | 36 void SetApplicationLocale(const std::string& language_code) override; |
43 | 37 |
44 // Called when the restart button is clicked. | 38 // Called when the restart button is clicked. |
45 void RestartCallback(const base::ListValue* args); | 39 void RestartCallback(const base::ListValue* args); |
46 | 40 |
47 DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandler); | 41 DISALLOW_COPY_AND_ASSIGN(LanguageOptionsHandler); |
48 }; | 42 }; |
49 | 43 |
50 } // namespace options | 44 } // namespace options |
51 | 45 |
52 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ | 46 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_LANGUAGE_OPTIONS_HANDLER_H_ |
OLD | NEW |