summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 17:50:01 +0000
committerglotov@google.com <glotov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 17:50:01 +0000
commit293caa54c215807abcef6a31aa34ca0e49e51581 (patch)
treeb21fd5f9b62466efc39a448fc6ad2af01e8943c6
parent1d583618bc0b28392e4d84db91dcf40ce96bd6a3 (diff)
downloadchromium_src-293caa54c215807abcef6a31aa34ca0e49e51581.zip
chromium_src-293caa54c215807abcef6a31aa34ca0e49e51581.tar.gz
chromium_src-293caa54c215807abcef6a31aa34ca0e49e51581.tar.bz2
Implemented saving of the chosen language for the next boot.
BUG=35248 TEST=Switch the language used by the ChromiumOS using the top left corner menu of the Network selection wizard. Or you may use the following command on desktop using Chromium (built with GYP_DEFINES="chromeos=1"): out/Debug/chrome --login-manager --login-screen=nework Review URL: http://codereview.chromium.org/912001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41445 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/login/network_selection_view.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/login/network_selection_view.cc b/chrome/browser/chromeos/login/network_selection_view.cc
index 81f9b23..f171f2a 100644
--- a/chrome/browser/chromeos/login/network_selection_view.cc
+++ b/chrome/browser/chromeos/login/network_selection_view.cc
@@ -13,6 +13,8 @@
#include "app/resource_bundle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/screen_observer.h"
+#include "chrome/browser/pref_service.h"
+#include "chrome/common/pref_names.h"
#include "chrome/browser/chromeos/options/network_config_view.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -323,7 +325,11 @@ bool NetworkSelectionView::GetAcceleratorForCommandId(
}
void NetworkSelectionView::ExecuteCommand(int command_id) {
- observer_->OnSwitchLanguage(languages_model_.GetLocaleFromIndex(command_id));
+ const std::string locale = languages_model_.GetLocaleFromIndex(command_id);
+ PrefService* prefs = g_browser_process->local_state();
+ prefs->SetString(prefs::kApplicationLocale, UTF8ToWide(locale));
+ prefs->ScheduleSavePersistentPrefs();
+ observer_->OnSwitchLanguage(locale);
// Don't do anything here because |this| has just been deleted in order
// to force releasing all locale-specific data.
}