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 |
337 if (!profile_manager->IsLoggedIn() || | 340 if (!profile_manager->IsLoggedIn() || |
338 !user_manager::UserManager::IsInitialized()) { | 341 !user_manager::UserManager::IsInitialized()) { |
339 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( | 342 return profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( |
340 profile_manager->user_data_dir()); | 343 profile_manager->user_data_dir()); |
341 } | 344 } |
342 | 345 |
343 user_manager::UserManager* manager = user_manager::UserManager::Get(); | 346 user_manager::UserManager* manager = user_manager::UserManager::Get(); |
344 const user_manager::User* user = manager->GetActiveUser(); | 347 const user_manager::User* user = manager->GetActiveUser(); |
345 // To avoid an endless loop (crbug.com/334098) we have to additionally check | 348 // To avoid an endless loop (crbug.com/334098) we have to additionally check |
346 // if the profile of the user was already created. If the profile was not yet | 349 // 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... |
1318 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1321 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1319 FinishDeletingProfile(profile_to_delete_path); | 1322 FinishDeletingProfile(profile_to_delete_path); |
1320 } | 1323 } |
1321 } | 1324 } |
1322 } | 1325 } |
1323 #endif | 1326 #endif |
1324 | 1327 |
1325 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1328 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1326 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1329 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1327 } | 1330 } |
OLD | NEW |