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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 #else | 327 #else |
328 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( | 328 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( |
329 profile_manager->user_data_dir()); | 329 profile_manager->user_data_dir()); |
330 #endif | 330 #endif |
331 } | 331 } |
332 | 332 |
333 // static | 333 // static |
334 Profile* ProfileManager::GetActiveUserProfile() { | 334 Profile* ProfileManager::GetActiveUserProfile() { |
335 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 335 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
336 #if defined(OS_CHROMEOS) | 336 #if defined(OS_CHROMEOS) |
337 if (!profile_manager) | |
338 return NULL; | |
339 | |
340 if (!profile_manager->IsLoggedIn() || | 337 if (!profile_manager->IsLoggedIn() || |
341 !user_manager::UserManager::IsInitialized()) { | 338 !user_manager::UserManager::IsInitialized()) { |
342 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( | 339 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( |
343 profile_manager->user_data_dir()); | 340 profile_manager->user_data_dir()); |
344 } | 341 } |
345 | 342 |
346 user_manager::UserManager* manager = user_manager::UserManager::Get(); | 343 user_manager::UserManager* manager = user_manager::UserManager::Get(); |
347 const user_manager::User* user = manager->GetActiveUser(); | 344 const user_manager::User* user = manager->GetActiveUser(); |
348 // To avoid an endless loop (crbug.com/334098) we have to additionally check | 345 // To avoid an endless loop (crbug.com/334098) we have to additionally check |
349 // if the profile of the user was already created. If the profile was not yet | 346 // if the profile of the user was already created. If the profile was not yet |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1318 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1322 FinishDeletingProfile(profile_to_delete_path); | 1319 FinishDeletingProfile(profile_to_delete_path); |
1323 } | 1320 } |
1324 } | 1321 } |
1325 } | 1322 } |
1326 #endif | 1323 #endif |
1327 | 1324 |
1328 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1325 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1329 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1326 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1330 } | 1327 } |
OLD | NEW |