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