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

Side by Side Diff: chrome/browser/dom_ui/options/language_options_handler.cc

Issue 6248017: Do not use local override for language settings: always sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bs removed Created 9 years, 11 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
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/dom_ui/options/language_options_handler.h" 5 #include "chrome/browser/dom_ui/options/language_options_handler.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 376 }
377 377
378 void LanguageOptionsHandler::UiLanguageChangeCallback( 378 void LanguageOptionsHandler::UiLanguageChangeCallback(
379 const ListValue* args) { 379 const ListValue* args) {
380 const std::string language_code = WideToASCII(ExtractStringValue(args)); 380 const std::string language_code = WideToASCII(ExtractStringValue(args));
381 CHECK(!language_code.empty()); 381 CHECK(!language_code.empty());
382 const std::string action = StringPrintf( 382 const std::string action = StringPrintf(
383 "LanguageOptions_UiLanguageChange_%s", language_code.c_str()); 383 "LanguageOptions_UiLanguageChange_%s", language_code.c_str());
384 UserMetrics::RecordComputedAction(action); 384 UserMetrics::RecordComputedAction(action);
385 #if defined(OS_CHROMEOS) 385 #if defined(OS_CHROMEOS)
386 dom_ui_->GetProfile()->ChangeApplicationLocale(language_code, false); 386 dom_ui_->GetProfile()->ChangeAppLocale(
387 language_code, Profile::APP_LOCALE_CHANGED_VIA_SETTINGS);
387 #else 388 #else
388 PrefService* pref_service = g_browser_process->local_state(); 389 PrefService* pref_service = g_browser_process->local_state();
389 pref_service->SetString(prefs::kApplicationLocale, language_code); 390 pref_service->SetString(prefs::kApplicationLocale, language_code);
390 #endif // defined(OS_CHROMEOS) 391 #endif // defined(OS_CHROMEOS)
391 dom_ui_->CallJavascriptFunction( 392 dom_ui_->CallJavascriptFunction(
392 L"options.LanguageOptions.uiLanguageSaved"); 393 L"options.LanguageOptions.uiLanguageSaved");
393 } 394 }
394 395
395 void LanguageOptionsHandler::SpellCheckLanguageChangeCallback( 396 void LanguageOptionsHandler::SpellCheckLanguageChangeCallback(
396 const ListValue* args) { 397 const ListValue* args) {
(...skipping 15 matching lines...) Expand all
412 #else 413 #else
413 UserMetrics::RecordAction(UserMetricsAction("LanguageOptions_Restart")); 414 UserMetrics::RecordAction(UserMetricsAction("LanguageOptions_Restart"));
414 415
415 // Set the flag to restore state after the restart. 416 // Set the flag to restore state after the restart.
416 PrefService* pref_service = g_browser_process->local_state(); 417 PrefService* pref_service = g_browser_process->local_state();
417 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, true); 418 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, true);
418 BrowserList::CloseAllBrowsersAndExit(); 419 BrowserList::CloseAllBrowsersAndExit();
419 #endif // defined(OS_CHROMEOS) 420 #endif // defined(OS_CHROMEOS)
420 } 421 }
421 422
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.cc ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698