| 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 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1344 void ProfileImpl::ChangeApplicationLocale( | 1344 void ProfileImpl::ChangeApplicationLocale( |
| 1345 const std::string& locale, bool keep_local) { | 1345 const std::string& locale, bool keep_local) { |
| 1346 if (locale.empty()) { | 1346 if (locale.empty()) { |
| 1347 NOTREACHED(); | 1347 NOTREACHED(); |
| 1348 return; | 1348 return; |
| 1349 } | 1349 } |
| 1350 if (keep_local) { | 1350 if (keep_local) { |
| 1351 GetPrefs()->SetString(prefs::kApplicationLocaleOverride, locale); | 1351 GetPrefs()->SetString(prefs::kApplicationLocaleOverride, locale); |
| 1352 } else { | 1352 } else { |
| 1353 GetPrefs()->SetString(prefs::kApplicationLocale, locale); | 1353 GetPrefs()->SetString(prefs::kApplicationLocale, locale); |
| 1354 GetPrefs()->SetString(prefs::kApplicationLocaleOverride, ""); | 1354 GetPrefs()->ClearPref(prefs::kApplicationLocaleOverride); |
| 1355 } | 1355 } |
| 1356 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, locale); | 1356 GetPrefs()->SetString(prefs::kApplicationLocaleBackup, locale); |
| 1357 GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted); | 1357 GetPrefs()->ClearPref(prefs::kApplicationLocaleAccepted); |
| 1358 // We maintain kApplicationLocale property in both a global storage | 1358 // We maintain kApplicationLocale property in both a global storage |
| 1359 // and user's profile. Global property determines locale of login screen, | 1359 // and user's profile. Global property determines locale of login screen, |
| 1360 // while user's profile determines his personal locale preference. | 1360 // while user's profile determines his personal locale preference. |
| 1361 g_browser_process->local_state()->SetString( | 1361 g_browser_process->local_state()->SetString( |
| 1362 prefs::kApplicationLocale, locale); | 1362 prefs::kApplicationLocale, locale); |
| 1363 | 1363 |
| 1364 GetPrefs()->SavePersistentPrefs(); | 1364 GetPrefs()->SavePersistentPrefs(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1389 } | 1389 } |
| 1390 | 1390 |
| 1391 PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1391 PrerenderManager* ProfileImpl::GetPrerenderManager() { |
| 1392 CommandLine* cl = CommandLine::ForCurrentProcess(); | 1392 CommandLine* cl = CommandLine::ForCurrentProcess(); |
| 1393 if (!cl->HasSwitch(switches::kEnablePagePrerender)) | 1393 if (!cl->HasSwitch(switches::kEnablePagePrerender)) |
| 1394 return NULL; | 1394 return NULL; |
| 1395 if (!prerender_manager_) | 1395 if (!prerender_manager_) |
| 1396 prerender_manager_ = new PrerenderManager(this); | 1396 prerender_manager_ = new PrerenderManager(this); |
| 1397 return prerender_manager_; | 1397 return prerender_manager_; |
| 1398 } | 1398 } |
| OLD | NEW |