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

Side by Side Diff: chrome/browser/profiles/profile_impl.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: rebase 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
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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 } 1359 }
1360 } 1360 }
1361 */ 1361 */
1362 return instant_promo_counter_.get(); 1362 return instant_promo_counter_.get();
1363 #else 1363 #else
1364 return NULL; 1364 return NULL;
1365 #endif 1365 #endif
1366 } 1366 }
1367 1367
1368 #if defined(OS_CHROMEOS) 1368 #if defined(OS_CHROMEOS)
1369 void ProfileImpl::ChangeApplicationLocale( 1369 void ProfileImpl::ChangeApplicationLocale(const std::string& locale) {
1370 const std::string& locale, bool keep_local) {
1371 if (locale.empty()) { 1370 if (locale.empty()) {
1372 NOTREACHED(); 1371 NOTREACHED();
1373 return; 1372 return;
1374 } 1373 }
1375 if (keep_local) { 1374 GetPrefs()->SetString(prefs::kApplicationLocale, locale);
1376 GetPrefs()->SetString(prefs::kApplicationLocaleOverride, locale);
1377 } else {
1378 GetPrefs()->SetString(prefs::kApplicationLocale, locale);
1379 GetPrefs()->ClearPref(prefs::kApplicationLocaleOverride);
1380 }
1381 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, locale); 1375 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, locale);
Nikita (slow) 2011/01/25 14:35:31 Why kApplicationLocaleBackup / Accepted prefs stat
Denis Lagno 2011/01/25 15:46:43 Backup must not be cleared. Backup should be kept
1382 GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted); 1376 GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted);
1383 // We maintain kApplicationLocale property in both a global storage 1377 // We maintain kApplicationLocale property in both a global storage
1384 // and user's profile. Global property determines locale of login screen, 1378 // and user's profile. Global property determines locale of login screen,
1385 // while user's profile determines his personal locale preference. 1379 // while user's profile determines his personal locale preference.
1386 g_browser_process->local_state()->SetString( 1380 g_browser_process->local_state()->SetString(
1387 prefs::kApplicationLocale, locale); 1381 prefs::kApplicationLocale, locale);
1388 1382
1389 GetPrefs()->SavePersistentPrefs(); 1383 GetPrefs()->SavePersistentPrefs();
1390 g_browser_process->local_state()->SavePersistentPrefs(); 1384 g_browser_process->local_state()->SavePersistentPrefs();
1391 } 1385 }
(...skipping 22 matching lines...) Expand all
1414 } 1408 }
1415 1409
1416 PrerenderManager* ProfileImpl::GetPrerenderManager() { 1410 PrerenderManager* ProfileImpl::GetPrerenderManager() {
1417 CommandLine* cl = CommandLine::ForCurrentProcess(); 1411 CommandLine* cl = CommandLine::ForCurrentProcess();
1418 if (!cl->HasSwitch(switches::kEnablePagePrerender)) 1412 if (!cl->HasSwitch(switches::kEnablePagePrerender))
1419 return NULL; 1413 return NULL;
1420 if (!prerender_manager_) 1414 if (!prerender_manager_)
1421 prerender_manager_ = new PrerenderManager(this); 1415 prerender_manager_ = new PrerenderManager(this);
1422 return prerender_manager_; 1416 return prerender_manager_;
1423 } 1417 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698