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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 | 942 |
943 // Perform initialization. | 943 // Perform initialization. |
944 if (success) { | 944 if (success) { |
945 DoFinalInit(profile, go_off_the_record); | 945 DoFinalInit(profile, go_off_the_record); |
946 if (go_off_the_record) | 946 if (go_off_the_record) |
947 profile = profile->GetOffTheRecordProfile(); | 947 profile = profile->GetOffTheRecordProfile(); |
948 info->created = true; | 948 info->created = true; |
949 } else { | 949 } else { |
950 profile = NULL; | 950 profile = NULL; |
951 profiles_info_.erase(iter); | 951 profiles_info_.erase(iter); |
| 952 // TODO(yiyaoliu): This is temporary, remove it after it's not used. |
| 953 UMA_HISTOGRAM_COUNTS_100("UMA.ProfilesCount.AfterErase", |
| 954 profiles_info_.size()); |
952 } | 955 } |
953 | 956 |
954 if (profile) { | 957 if (profile) { |
955 // If this was the guest profile, finish setting its special status. | 958 // If this was the guest profile, finish setting its special status. |
956 if (profile->GetPath() == ProfileManager::GetGuestProfilePath()) | 959 if (profile->GetPath() == ProfileManager::GetGuestProfilePath()) |
957 SetGuestProfilePrefs(profile); | 960 SetGuestProfilePrefs(profile); |
958 | 961 |
959 // Invoke CREATED callback for incognito profiles. | 962 // Invoke CREATED callback for incognito profiles. |
960 if (go_off_the_record) | 963 if (go_off_the_record) |
961 RunCallbacks(callbacks, profile, Profile::CREATE_STATUS_CREATED); | 964 RunCallbacks(callbacks, profile, Profile::CREATE_STATUS_CREATED); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1315 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1313 FinishDeletingProfile(profile_to_delete_path); | 1316 FinishDeletingProfile(profile_to_delete_path); |
1314 } | 1317 } |
1315 } | 1318 } |
1316 } | 1319 } |
1317 #endif | 1320 #endif |
1318 | 1321 |
1319 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1322 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1320 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1323 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1321 } | 1324 } |
OLD | NEW |