OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
632 } | 632 } |
633 | 633 |
634 void ProfileManager::BrowserListObserver::OnBrowserAdded( | 634 void ProfileManager::BrowserListObserver::OnBrowserAdded( |
635 Browser* browser) {} | 635 Browser* browser) {} |
636 | 636 |
637 void ProfileManager::BrowserListObserver::OnBrowserRemoved( | 637 void ProfileManager::BrowserListObserver::OnBrowserRemoved( |
638 Browser* browser) {} | 638 Browser* browser) {} |
639 | 639 |
640 void ProfileManager::BrowserListObserver::OnBrowserSetLastActive( | 640 void ProfileManager::BrowserListObserver::OnBrowserSetLastActive( |
641 Browser* browser) { | 641 Browser* browser) { |
642 if (profile_manager_->closing_all_browsers_) | |
sail
2012/07/27 16:58:40
this needs a comment
| |
643 return; | |
644 | |
642 Profile* last_active = browser->profile(); | 645 Profile* last_active = browser->profile(); |
643 PrefService* local_state = g_browser_process->local_state(); | 646 PrefService* local_state = g_browser_process->local_state(); |
644 DCHECK(local_state); | 647 DCHECK(local_state); |
645 // Only keep track of profiles that we are managing; tests may create others. | 648 // Only keep track of profiles that we are managing; tests may create others. |
646 if (profile_manager_->profiles_info_.find( | 649 if (profile_manager_->profiles_info_.find( |
647 last_active->GetPath()) != profile_manager_->profiles_info_.end()) { | 650 last_active->GetPath()) != profile_manager_->profiles_info_.end()) { |
648 local_state->SetString(prefs::kProfileLastUsed, | 651 local_state->SetString(prefs::kProfileLastUsed, |
649 last_active->GetPath().BaseName().MaybeAsASCII()); | 652 last_active->GetPath().BaseName().MaybeAsASCII()); |
650 } | 653 } |
651 } | 654 } |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1012 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 1015 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
1013 Profile* profile, | 1016 Profile* profile, |
1014 Profile::CreateStatus status) { | 1017 Profile::CreateStatus status) { |
1015 for (size_t i = 0; i < callbacks.size(); ++i) | 1018 for (size_t i = 0; i < callbacks.size(); ++i) |
1016 callbacks[i].Run(profile, status); | 1019 callbacks[i].Run(profile, status); |
1017 } | 1020 } |
1018 | 1021 |
1019 ProfileManager::ProfileInfo::~ProfileInfo() { | 1022 ProfileManager::ProfileInfo::~ProfileInfo() { |
1020 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 1023 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
1021 } | 1024 } |
OLD | NEW |