| 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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 | 972 |
| 973 // static | 973 // static |
| 974 bool ProfileManager::IsMultipleProfilesEnabled() { | 974 bool ProfileManager::IsMultipleProfilesEnabled() { |
| 975 #if defined(OS_ANDROID) | 975 #if defined(OS_ANDROID) |
| 976 return false; | 976 return false; |
| 977 #endif | 977 #endif |
| 978 #if defined(OS_CHROMEOS) | 978 #if defined(OS_CHROMEOS) |
| 979 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles)) | 979 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles)) |
| 980 return false; | 980 return false; |
| 981 #endif | 981 #endif |
| 982 #if defined(OS_WIN) | |
| 983 if (base::win::IsMetroProcess()) | |
| 984 return false; | |
| 985 #endif | |
| 986 return !ManagedMode::IsInManagedMode(); | 982 return !ManagedMode::IsInManagedMode(); |
| 987 } | 983 } |
| 988 | 984 |
| 989 void ProfileManager::AutoloadProfiles() { | 985 void ProfileManager::AutoloadProfiles() { |
| 990 ProfileInfoCache& cache = GetProfileInfoCache(); | 986 ProfileInfoCache& cache = GetProfileInfoCache(); |
| 991 size_t number_of_profiles = cache.GetNumberOfProfiles(); | 987 size_t number_of_profiles = cache.GetNumberOfProfiles(); |
| 992 for (size_t p = 0; p < number_of_profiles; ++p) { | 988 for (size_t p = 0; p < number_of_profiles; ++p) { |
| 993 if (cache.GetBackgroundStatusOfProfileAtIndex(p)) { | 989 if (cache.GetBackgroundStatusOfProfileAtIndex(p)) { |
| 994 // If status is true, that profile is running background apps. By calling | 990 // If status is true, that profile is running background apps. By calling |
| 995 // GetProfile, we automatically cause the profile to be loaded which will | 991 // GetProfile, we automatically cause the profile to be loaded which will |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1024 ProfileManager::ProfileInfo::ProfileInfo( | 1020 ProfileManager::ProfileInfo::ProfileInfo( |
| 1025 Profile* profile, | 1021 Profile* profile, |
| 1026 bool created) | 1022 bool created) |
| 1027 : profile(profile), | 1023 : profile(profile), |
| 1028 created(created) { | 1024 created(created) { |
| 1029 } | 1025 } |
| 1030 | 1026 |
| 1031 ProfileManager::ProfileInfo::~ProfileInfo() { | 1027 ProfileManager::ProfileInfo::~ProfileInfo() { |
| 1032 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 1028 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
| 1033 } | 1029 } |
| OLD | NEW |