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