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 "chrome/browser/profiles/profile_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "extensions/browser/extension_system.h" | 75 #include "extensions/browser/extension_system.h" |
76 #endif // !defined (OS_IOS) | 76 #endif // !defined (OS_IOS) |
77 | 77 |
78 #if defined(OS_WIN) | 78 #if defined(OS_WIN) |
79 #include "base/win/metro.h" | 79 #include "base/win/metro.h" |
80 #include "chrome/installer/util/browser_distribution.h" | 80 #include "chrome/installer/util/browser_distribution.h" |
81 #endif | 81 #endif |
82 | 82 |
83 #if defined(OS_CHROMEOS) | 83 #if defined(OS_CHROMEOS) |
84 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 84 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
85 #include "chrome/browser/chromeos/login/users/user.h" | |
86 #include "chrome/browser/chromeos/login/users/user_manager.h" | 85 #include "chrome/browser/chromeos/login/users/user_manager.h" |
87 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 86 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
88 #include "chrome/browser/profiles/profiles_state.h" | 87 #include "chrome/browser/profiles/profiles_state.h" |
89 #include "chromeos/chromeos_switches.h" | 88 #include "chromeos/chromeos_switches.h" |
90 #include "chromeos/dbus/cryptohome_client.h" | 89 #include "chromeos/dbus/cryptohome_client.h" |
91 #include "chromeos/dbus/dbus_thread_manager.h" | 90 #include "chromeos/dbus/dbus_thread_manager.h" |
| 91 #include "components/user_manager/user.h" |
92 #endif | 92 #endif |
93 | 93 |
94 using base::UserMetricsAction; | 94 using base::UserMetricsAction; |
95 using content::BrowserThread; | 95 using content::BrowserThread; |
96 | 96 |
97 namespace { | 97 namespace { |
98 | 98 |
99 // Profiles that should be deleted on shutdown. | 99 // Profiles that should be deleted on shutdown. |
100 std::vector<base::FilePath>& ProfilesToDelete() { | 100 std::vector<base::FilePath>& ProfilesToDelete() { |
101 CR_DEFINE_STATIC_LOCAL(std::vector<base::FilePath>, profiles_to_delete, ()); | 101 CR_DEFINE_STATIC_LOCAL(std::vector<base::FilePath>, profiles_to_delete, ()); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 Profile* ProfileManager::GetActiveUserProfile() { | 330 Profile* ProfileManager::GetActiveUserProfile() { |
331 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 331 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
332 #if defined(OS_CHROMEOS) | 332 #if defined(OS_CHROMEOS) |
333 if (!profile_manager->IsLoggedIn() || | 333 if (!profile_manager->IsLoggedIn() || |
334 !chromeos::UserManager::IsInitialized()) { | 334 !chromeos::UserManager::IsInitialized()) { |
335 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( | 335 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( |
336 profile_manager->user_data_dir()); | 336 profile_manager->user_data_dir()); |
337 } | 337 } |
338 | 338 |
339 chromeos::UserManager* manager = chromeos::UserManager::Get(); | 339 chromeos::UserManager* manager = chromeos::UserManager::Get(); |
340 const chromeos::User* user = manager->GetActiveUser(); | 340 const user_manager::User* user = manager->GetActiveUser(); |
341 // To avoid an endless loop (crbug.com/334098) we have to additionally check | 341 // To avoid an endless loop (crbug.com/334098) we have to additionally check |
342 // if the profile of the user was already created. If the profile was not yet | 342 // if the profile of the user was already created. If the profile was not yet |
343 // created we load the profile using the profile directly. | 343 // created we load the profile using the profile directly. |
344 // TODO: This should be cleaned up with the new profile manager. | 344 // TODO: This should be cleaned up with the new profile manager. |
345 if (user && user->is_profile_created()) | 345 if (user && user->is_profile_created()) |
346 return chromeos::ProfileHelper::Get()->GetProfileByUser(user); | 346 return chromeos::ProfileHelper::Get()->GetProfileByUser(user); |
347 | 347 |
348 #endif | 348 #endif |
349 Profile* profile = | 349 Profile* profile = |
350 profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( | 350 profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1324 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1325 FinishDeletingProfile(profile_to_delete_path); | 1325 FinishDeletingProfile(profile_to_delete_path); |
1326 } | 1326 } |
1327 } | 1327 } |
1328 } | 1328 } |
1329 #endif | 1329 #endif |
1330 | 1330 |
1331 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1331 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1332 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1332 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1333 } | 1333 } |
OLD | NEW |