OLD | NEW |
---|---|
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 Loading... | |
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 dont_sync) { | |
whywhat
2011/01/11 10:24:14
Why not use positive name, smth like sync?
Though
Denis Lagno
2011/01/12 15:33:28
OK. I switched back to "keep_local".
It was origi
| |
1345 if (locale.empty()) { | |
1346 NOTREACHED(); | |
1347 return; | |
1348 } | |
1349 // We maintain kApplicationLocale property in both a global storage | |
1350 // and user's profile. Global property determines locale of login screen, | |
1351 // while user's profile determines his personal locale preference. | |
1352 PrefService* prefs[] = { | |
whywhat
2011/01/11 10:24:14
I don't think using array is justified but the sma
Denis Lagno
2011/01/12 15:33:28
Done.
| |
1353 GetPrefs(), | |
1354 g_browser_process->local_state() | |
1355 }; | |
1356 if (dont_sync) { | |
1357 prefs[0]->SetString(prefs::kApplicationLocaleOverride, locale); | |
1358 } else { | |
1359 prefs[0]->SetString(prefs::kApplicationLocale, locale); | |
1360 prefs[0]->SetString(prefs::kApplicationLocaleOverride, ""); | |
1361 } | |
1362 prefs[0]->SetString(prefs::kApplicationLocaleBackup, locale); | |
1363 prefs[0]->ClearPref(prefs::kApplicationLocaleAccepted); | |
1364 prefs[1]->SetString(prefs::kApplicationLocale, locale); | |
1365 for (size_t i = 0; i < arraysize(prefs); ++i) | |
1366 prefs[i]->SavePersistentPrefs(); | |
1367 } | |
1368 | |
1343 chromeos::ProxyConfigServiceImpl* | 1369 chromeos::ProxyConfigServiceImpl* |
1344 ProfileImpl::GetChromeOSProxyConfigServiceImpl() { | 1370 ProfileImpl::GetChromeOSProxyConfigServiceImpl() { |
1345 if (!chromeos_proxy_config_service_impl_) { | 1371 if (!chromeos_proxy_config_service_impl_) { |
1346 chromeos_proxy_config_service_impl_ = | 1372 chromeos_proxy_config_service_impl_ = |
1347 new chromeos::ProxyConfigServiceImpl(); | 1373 new chromeos::ProxyConfigServiceImpl(); |
1348 } | 1374 } |
1349 return chromeos_proxy_config_service_impl_; | 1375 return chromeos_proxy_config_service_impl_; |
1350 } | 1376 } |
1351 | 1377 |
1352 void ProfileImpl::SetupChromeOSEnterpriseExtensionObserver() { | 1378 void ProfileImpl::SetupChromeOSEnterpriseExtensionObserver() { |
(...skipping 11 matching lines...) Expand all Loading... | |
1364 } | 1390 } |
1365 | 1391 |
1366 PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1392 PrerenderManager* ProfileImpl::GetPrerenderManager() { |
1367 CommandLine* cl = CommandLine::ForCurrentProcess(); | 1393 CommandLine* cl = CommandLine::ForCurrentProcess(); |
1368 if (!cl->HasSwitch(switches::kEnablePagePrerender)) | 1394 if (!cl->HasSwitch(switches::kEnablePagePrerender)) |
1369 return NULL; | 1395 return NULL; |
1370 if (!prerender_manager_.get()) | 1396 if (!prerender_manager_.get()) |
1371 prerender_manager_.reset(new PrerenderManager(this)); | 1397 prerender_manager_.reset(new PrerenderManager(this)); |
1372 return prerender_manager_.get(); | 1398 return prerender_manager_.get(); |
1373 } | 1399 } |
OLD | NEW |