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