| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 | 418 |
| 419 void ProfileManager::Observe( | 419 void ProfileManager::Observe( |
| 420 int type, | 420 int type, |
| 421 const content::NotificationSource& source, | 421 const content::NotificationSource& source, |
| 422 const content::NotificationDetails& details) { | 422 const content::NotificationDetails& details) { |
| 423 #if defined(OS_CHROMEOS) | 423 #if defined(OS_CHROMEOS) |
| 424 if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) { | 424 if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) { |
| 425 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 425 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 426 if (chromeos::CrosLibrary::Get()->EnsureLoaded() && | 426 if (!command_line.HasSwitch(switches::kTestType)) { |
| 427 !command_line.HasSwitch(switches::kTestType)) { | |
| 428 // If we don't have a mounted profile directory we're in trouble. | 427 // If we don't have a mounted profile directory we're in trouble. |
| 429 // TODO(davemoore) Once we have better api this check should ensure that | 428 // TODO(davemoore) Once we have better api this check should ensure that |
| 430 // our profile directory is the one that's mounted, and that it's mounted | 429 // our profile directory is the one that's mounted, and that it's mounted |
| 431 // as the current user. | 430 // as the current user. |
| 432 CHECK(chromeos::CrosLibrary::Get()->GetCryptohomeLibrary()->IsMounted()); | 431 CHECK(chromeos::CrosLibrary::Get()->GetCryptohomeLibrary()->IsMounted()); |
| 433 } | 432 } |
| 434 logged_in_ = true; | 433 logged_in_ = true; |
| 435 } | 434 } |
| 436 #endif | 435 #endif |
| 437 } | 436 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 676 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 678 const FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 677 const FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 679 } | 678 } |
| 680 | 679 |
| 681 void ProfileManager::RegisterTestingProfile(Profile* profile, | 680 void ProfileManager::RegisterTestingProfile(Profile* profile, |
| 682 bool add_to_cache) { | 681 bool add_to_cache) { |
| 683 RegisterProfile(profile, true); | 682 RegisterProfile(profile, true); |
| 684 if (add_to_cache) | 683 if (add_to_cache) |
| 685 AddProfileToCache(profile); | 684 AddProfileToCache(profile); |
| 686 } | 685 } |
| OLD | NEW |