| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 UserMetricsAction("ManagedMode_LocallyManagedUserCreated")); | 376 UserMetricsAction("ManagedMode_LocallyManagedUserCreated")); |
| 377 } | 377 } |
| 378 | 378 |
| 379 ProfileMetrics::UpdateReportedProfilesStatistics(this); | 379 ProfileMetrics::UpdateReportedProfilesStatistics(this); |
| 380 } | 380 } |
| 381 | 381 |
| 382 // Call or enqueue the callback. | 382 // Call or enqueue the callback. |
| 383 if (!callback.is_null()) { | 383 if (!callback.is_null()) { |
| 384 if (iter != profiles_info_.end() && info->created) { | 384 if (iter != profiles_info_.end() && info->created) { |
| 385 Profile* profile = info->profile.get(); | 385 Profile* profile = info->profile.get(); |
| 386 // If this was the guest profile, apply settings. | 386 // If this was the guest profile, apply settings and go OffTheRecord. |
| 387 if (profile->GetPath() == ProfileManager::GetGuestProfilePath()) | 387 if (profile->GetPath() == ProfileManager::GetGuestProfilePath()) { |
| 388 SetGuestProfilePrefs(profile); | 388 SetGuestProfilePrefs(profile); |
| 389 profile = profile->GetOffTheRecordProfile(); |
| 390 } |
| 389 // Profile has already been created. Run callback immediately. | 391 // Profile has already been created. Run callback immediately. |
| 390 callback.Run(profile, Profile::CREATE_STATUS_INITIALIZED); | 392 callback.Run(profile, Profile::CREATE_STATUS_INITIALIZED); |
| 391 } else { | 393 } else { |
| 392 // Profile is either already in the process of being created, or new. | 394 // Profile is either already in the process of being created, or new. |
| 393 // Add callback to the list. | 395 // Add callback to the list. |
| 394 info->callbacks.push_back(callback); | 396 info->callbacks.push_back(callback); |
| 395 } | 397 } |
| 396 } | 398 } |
| 397 } | 399 } |
| 398 | 400 |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 last_non_managed_profile_path.BaseName().MaybeAsASCII()); | 1242 last_non_managed_profile_path.BaseName().MaybeAsASCII()); |
| 1241 FinishDeletingProfile(profile_to_delete_path); | 1243 FinishDeletingProfile(profile_to_delete_path); |
| 1242 } | 1244 } |
| 1243 } | 1245 } |
| 1244 } | 1246 } |
| 1245 #endif | 1247 #endif |
| 1246 | 1248 |
| 1247 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1249 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1248 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1250 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1249 } | 1251 } |
| OLD | NEW |