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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 5976005: show notification on locale change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment 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 "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 } 1333 }
1334 } 1334 }
1335 */ 1335 */
1336 return instant_promo_counter_.get(); 1336 return instant_promo_counter_.get();
1337 #else 1337 #else
1338 return NULL; 1338 return NULL;
1339 #endif 1339 #endif
1340 } 1340 }
1341 1341
1342 #if defined(OS_CHROMEOS) 1342 #if defined(OS_CHROMEOS)
1343 void ProfileImpl::ChangeApplicationLocale(
1344 const std::string& locale, bool keep_local) {
1345 if (locale.empty()) {
1346 NOTREACHED();
1347 return;
1348 }
1349 if (keep_local) {
1350 GetPrefs()->SetString(prefs::kApplicationLocaleOverride, locale);
1351 } else {
1352 GetPrefs()->SetString(prefs::kApplicationLocale, locale);
1353 GetPrefs()->SetString(prefs::kApplicationLocaleOverride, "");
1354 }
1355 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, locale);
1356 GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted);
1357 // We maintain kApplicationLocale property in both a global storage
1358 // and user's profile. Global property determines locale of login screen,
1359 // while user's profile determines his personal locale preference.
1360 g_browser_process->local_state()->SetString(
1361 prefs::kApplicationLocale, locale);
1362
1363 GetPrefs()->SavePersistentPrefs();
1364 g_browser_process->local_state()->SavePersistentPrefs();
1365 }
1366
1343 chromeos::ProxyConfigServiceImpl* 1367 chromeos::ProxyConfigServiceImpl*
1344 ProfileImpl::GetChromeOSProxyConfigServiceImpl() { 1368 ProfileImpl::GetChromeOSProxyConfigServiceImpl() {
1345 if (!chromeos_proxy_config_service_impl_) { 1369 if (!chromeos_proxy_config_service_impl_) {
1346 chromeos_proxy_config_service_impl_ = 1370 chromeos_proxy_config_service_impl_ =
1347 new chromeos::ProxyConfigServiceImpl(); 1371 new chromeos::ProxyConfigServiceImpl();
1348 } 1372 }
1349 return chromeos_proxy_config_service_impl_; 1373 return chromeos_proxy_config_service_impl_;
1350 } 1374 }
1351 1375
1352 void ProfileImpl::SetupChromeOSEnterpriseExtensionObserver() { 1376 void ProfileImpl::SetupChromeOSEnterpriseExtensionObserver() {
(...skipping 11 matching lines...) Expand all
1364 } 1388 }
1365 1389
1366 PrerenderManager* ProfileImpl::GetPrerenderManager() { 1390 PrerenderManager* ProfileImpl::GetPrerenderManager() {
1367 CommandLine* cl = CommandLine::ForCurrentProcess(); 1391 CommandLine* cl = CommandLine::ForCurrentProcess();
1368 if (!cl->HasSwitch(switches::kEnablePagePrerender)) 1392 if (!cl->HasSwitch(switches::kEnablePagePrerender))
1369 return NULL; 1393 return NULL;
1370 if (!prerender_manager_) 1394 if (!prerender_manager_)
1371 prerender_manager_ = new PrerenderManager(this); 1395 prerender_manager_ = new PrerenderManager(this);
1372 return prerender_manager_; 1396 return prerender_manager_;
1373 } 1397 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698