| 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 "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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 if (!prefs_.get()) { | 685 if (!prefs_.get()) { |
| 686 prefs_.reset(PrefService::CreatePrefService( | 686 prefs_.reset(PrefService::CreatePrefService( |
| 687 GetPrefFilePath(), | 687 GetPrefFilePath(), |
| 688 new ExtensionPrefStore(GetExtensionPrefValueMap(), false), | 688 new ExtensionPrefStore(GetExtensionPrefValueMap(), false), |
| 689 GetOriginalProfile())); | 689 GetOriginalProfile())); |
| 690 | 690 |
| 691 // The Profile class and ProfileManager class may read some prefs so | 691 // The Profile class and ProfileManager class may read some prefs so |
| 692 // register known prefs as soon as possible. | 692 // register known prefs as soon as possible. |
| 693 Profile::RegisterUserPrefs(prefs_.get()); | 693 Profile::RegisterUserPrefs(prefs_.get()); |
| 694 browser::RegisterUserPrefs(prefs_.get()); | 694 browser::RegisterUserPrefs(prefs_.get()); |
| 695 // TODO(mirandac): remove migration code after 6 months (crbug.com/69995). |
| 696 if (g_browser_process->local_state()) { |
| 697 browser::MigrateBrowserPrefs(prefs_.get(), |
| 698 g_browser_process->local_state()); |
| 699 } |
| 695 | 700 |
| 696 // The last session exited cleanly if there is no pref for | 701 // The last session exited cleanly if there is no pref for |
| 697 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. | 702 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. |
| 698 last_session_exited_cleanly_ = | 703 last_session_exited_cleanly_ = |
| 699 prefs_->GetBoolean(prefs::kSessionExitedCleanly); | 704 prefs_->GetBoolean(prefs::kSessionExitedCleanly); |
| 700 // Mark the session as open. | 705 // Mark the session as open. |
| 701 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); | 706 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); |
| 702 // Make sure we save to disk that the session has opened. | 707 // Make sure we save to disk that the session has opened. |
| 703 prefs_->ScheduleSavePersistentPrefs(); | 708 prefs_->ScheduleSavePersistentPrefs(); |
| 704 | 709 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 } | 1472 } |
| 1468 | 1473 |
| 1469 PrerenderManager* ProfileImpl::GetPrerenderManager() { | 1474 PrerenderManager* ProfileImpl::GetPrerenderManager() { |
| 1470 CommandLine* cl = CommandLine::ForCurrentProcess(); | 1475 CommandLine* cl = CommandLine::ForCurrentProcess(); |
| 1471 if (!cl->HasSwitch(switches::kEnablePagePrerender)) | 1476 if (!cl->HasSwitch(switches::kEnablePagePrerender)) |
| 1472 return NULL; | 1477 return NULL; |
| 1473 if (!prerender_manager_) | 1478 if (!prerender_manager_) |
| 1474 prerender_manager_ = new PrerenderManager(this); | 1479 prerender_manager_ = new PrerenderManager(this); |
| 1475 return prerender_manager_; | 1480 return prerender_manager_; |
| 1476 } | 1481 } |
| OLD | NEW |