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

Side by Side Diff: chrome/browser/chromeos/login/language_switch_menu.cc

Issue 3132023: Add language_prefs namespace to language_preferences.h. (Closed)
Patch Set: address comments Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/chromeos/login/language_switch_menu.h" 5 #include "chrome/browser/chromeos/login/language_switch_menu.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/input_method/input_method_util.h" 10 #include "chrome/browser/chromeos/input_method/input_method_util.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // TODO(markusheintz): Change the if condition to prefs->IsUserModifiable() 92 // TODO(markusheintz): Change the if condition to prefs->IsUserModifiable()
93 // once Mattias landed his pending patch. 93 // once Mattias landed his pending patch.
94 if (!prefs->IsManagedPreference(prefs::kApplicationLocale)) { 94 if (!prefs->IsManagedPreference(prefs::kApplicationLocale)) {
95 prefs->SetString(prefs::kApplicationLocale, locale); 95 prefs->SetString(prefs::kApplicationLocale, locale);
96 prefs->SavePersistentPrefs(); 96 prefs->SavePersistentPrefs();
97 97
98 // Switch the locale. 98 // Switch the locale.
99 ResourceBundle::ReloadSharedInstance(locale); 99 ResourceBundle::ReloadSharedInstance(locale);
100 100
101 // Enable the keyboard layouts that are necessary for the new locale. 101 // Enable the keyboard layouts that are necessary for the new locale.
102 chromeos::input_method::EnableInputMethods( 102 input_method::EnableInputMethods(
103 locale, chromeos::input_method::kKeyboardLayoutsOnly, 103 locale, input_method::kKeyboardLayoutsOnly,
104 kHardwareKeyboardLayout); 104 language_prefs::kHardwareKeyboardLayout);
105 105
106 // The following line does not seem to affect locale anyhow. Maybe in 106 // The following line does not seem to affect locale anyhow. Maybe in
107 // future.. 107 // future..
108 g_browser_process->SetApplicationLocale(locale); 108 g_browser_process->SetApplicationLocale(locale);
109 } 109 }
110 } 110 }
111 111
112 //////////////////////////////////////////////////////////////////////////////// 112 ////////////////////////////////////////////////////////////////////////////////
113 // views::ViewMenuDelegate implementation. 113 // views::ViewMenuDelegate implementation.
114 114
(...skipping 23 matching lines...) Expand all
138 void LanguageSwitchMenu::ExecuteCommand(int command_id) { 138 void LanguageSwitchMenu::ExecuteCommand(int command_id) {
139 const std::string locale = language_list_->GetLocaleFromIndex(command_id); 139 const std::string locale = language_list_->GetLocaleFromIndex(command_id);
140 SwitchLanguage(locale); 140 SwitchLanguage(locale);
141 InitLanguageMenu(); 141 InitLanguageMenu();
142 142
143 // Update all view hierarchies that the locale has changed. 143 // Update all view hierarchies that the locale has changed.
144 views::Widget::NotifyLocaleChanged(); 144 views::Widget::NotifyLocaleChanged();
145 } 145 }
146 146
147 } // namespace chromeos 147 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/language_preferences_unittest.cc ('k') | chrome/browser/chromeos/login/screen_locker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698