Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1105)

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/cros_language_options_handler.cc

Issue 10857071: Options: Rename options2 namespace to options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/ui/webui/options2/chromeos/cros_language_options_handle r.h" 5 #include "chrome/browser/ui/webui/options2/chromeos/cros_language_options_handle r.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 14 matching lines...) Expand all
25 #include "content/public/browser/navigation_controller.h" 25 #include "content/public/browser/navigation_controller.h"
26 #include "content/public/browser/user_metrics.h" 26 #include "content/public/browser/user_metrics.h"
27 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
28 #include "grit/chromium_strings.h" 28 #include "grit/chromium_strings.h"
29 #include "grit/generated_resources.h" 29 #include "grit/generated_resources.h"
30 #include "ui/base/l10n/l10n_util.h" 30 #include "ui/base/l10n/l10n_util.h"
31 31
32 using content::UserMetricsAction; 32 using content::UserMetricsAction;
33 33
34 namespace chromeos { 34 namespace chromeos {
35 namespace options2 { 35 namespace options {
36 36
37 CrosLanguageOptionsHandler::CrosLanguageOptionsHandler() { 37 CrosLanguageOptionsHandler::CrosLanguageOptionsHandler() {
38 } 38 }
39 39
40 CrosLanguageOptionsHandler::~CrosLanguageOptionsHandler() { 40 CrosLanguageOptionsHandler::~CrosLanguageOptionsHandler() {
41 } 41 }
42 42
43 void CrosLanguageOptionsHandler::GetLocalizedValues( 43 void CrosLanguageOptionsHandler::GetLocalizedValues(
44 DictionaryValue* localized_strings) { 44 DictionaryValue* localized_strings) {
45 ::options2::LanguageOptionsHandlerCommon::GetLocalizedValues( 45 ::options::LanguageOptionsHandlerCommon::GetLocalizedValues(
46 localized_strings); 46 localized_strings);
47 47
48 RegisterTitle(localized_strings, "languagePage", 48 RegisterTitle(localized_strings, "languagePage",
49 IDS_OPTIONS_SETTINGS_LANGUAGES_AND_INPUT_DIALOG_TITLE); 49 IDS_OPTIONS_SETTINGS_LANGUAGES_AND_INPUT_DIALOG_TITLE);
50 localized_strings->SetString("ok_button", l10n_util::GetStringUTF16(IDS_OK)); 50 localized_strings->SetString("ok_button", l10n_util::GetStringUTF16(IDS_OK));
51 localized_strings->SetString("configure", 51 localized_strings->SetString("configure",
52 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_CONFIGURE)); 52 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_CONFIGURE));
53 localized_strings->SetString("input_method", 53 localized_strings->SetString("input_method",
54 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_INPUT_METHOD)); 54 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_LANGUAGES_INPUT_METHOD));
55 localized_strings->SetString("please_add_another_input_method", 55 localized_strings->SetString("please_add_another_input_method",
(...skipping 15 matching lines...) Expand all
71 input_method::InputMethodManager* manager = 71 input_method::InputMethodManager* manager =
72 input_method::InputMethodManager::GetInstance(); 72 input_method::InputMethodManager::GetInstance();
73 // GetSupportedInputMethods() never return NULL. 73 // GetSupportedInputMethods() never return NULL.
74 scoped_ptr<input_method::InputMethodDescriptors> descriptors( 74 scoped_ptr<input_method::InputMethodDescriptors> descriptors(
75 manager->GetSupportedInputMethods()); 75 manager->GetSupportedInputMethods());
76 localized_strings->Set("languageList", GetLanguageList(*descriptors)); 76 localized_strings->Set("languageList", GetLanguageList(*descriptors));
77 localized_strings->Set("inputMethodList", GetInputMethodList(*descriptors)); 77 localized_strings->Set("inputMethodList", GetInputMethodList(*descriptors));
78 } 78 }
79 79
80 void CrosLanguageOptionsHandler::RegisterMessages() { 80 void CrosLanguageOptionsHandler::RegisterMessages() {
81 ::options2::LanguageOptionsHandlerCommon::RegisterMessages(); 81 ::options::LanguageOptionsHandlerCommon::RegisterMessages();
82 82
83 web_ui()->RegisterMessageCallback("inputMethodDisable", 83 web_ui()->RegisterMessageCallback("inputMethodDisable",
84 base::Bind(&CrosLanguageOptionsHandler::InputMethodDisableCallback, 84 base::Bind(&CrosLanguageOptionsHandler::InputMethodDisableCallback,
85 base::Unretained(this))); 85 base::Unretained(this)));
86 web_ui()->RegisterMessageCallback("inputMethodEnable", 86 web_ui()->RegisterMessageCallback("inputMethodEnable",
87 base::Bind(&CrosLanguageOptionsHandler::InputMethodEnableCallback, 87 base::Bind(&CrosLanguageOptionsHandler::InputMethodEnableCallback,
88 base::Unretained(this))); 88 base::Unretained(this)));
89 web_ui()->RegisterMessageCallback("inputMethodOptionsOpen", 89 web_ui()->RegisterMessageCallback("inputMethodOptionsOpen",
90 base::Bind(&CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback, 90 base::Bind(&CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback,
91 base::Unretained(this))); 91 base::Unretained(this)));
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } 235 }
236 236
237 void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback( 237 void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback(
238 const ListValue* args) { 238 const ListValue* args) {
239 const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args)); 239 const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args));
240 const std::string action = base::StringPrintf( 240 const std::string action = base::StringPrintf(
241 "InputMethodOptions_Open_%s", input_method_id.c_str()); 241 "InputMethodOptions_Open_%s", input_method_id.c_str());
242 content::RecordComputedAction(action); 242 content::RecordComputedAction(action);
243 } 243 }
244 244
245 } // namespace options2 245 } // namespace options
246 } // namespace chromeos 246 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698