| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/signin/signin_create_profile_handler.h" | 5 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 const base::ListValue* args) { | 163 const base::ListValue* args) { |
| 164 base::ListValue user_info_list; | 164 base::ListValue user_info_list; |
| 165 std::vector<ProfileAttributesEntry*> entries = | 165 std::vector<ProfileAttributesEntry*> entries = |
| 166 g_browser_process->profile_manager()-> | 166 g_browser_process->profile_manager()-> |
| 167 GetProfileAttributesStorage().GetAllProfilesAttributesSortedByName(); | 167 GetProfileAttributesStorage().GetAllProfilesAttributesSortedByName(); |
| 168 for (ProfileAttributesEntry* entry : entries) { | 168 for (ProfileAttributesEntry* entry : entries) { |
| 169 base::string16 username = entry->GetUserName(); | 169 base::string16 username = entry->GetUserName(); |
| 170 if (username.empty()) | 170 if (username.empty()) |
| 171 continue; | 171 continue; |
| 172 base::string16 profile_path = entry->GetPath().AsUTF16Unsafe(); | 172 base::string16 profile_path = entry->GetPath().AsUTF16Unsafe(); |
| 173 scoped_ptr<base::DictionaryValue> user_info(new base::DictionaryValue()); | 173 std::unique_ptr<base::DictionaryValue> user_info( |
| 174 new base::DictionaryValue()); |
| 174 user_info->SetString("username", username); | 175 user_info->SetString("username", username); |
| 175 user_info->SetString("profilePath", profile_path); | 176 user_info->SetString("profilePath", profile_path); |
| 176 | 177 |
| 177 user_info_list.Append(std::move(user_info)); | 178 user_info_list.Append(std::move(user_info)); |
| 178 } | 179 } |
| 179 web_ui()->CallJavascriptFunction("cr.webUIListenerCallback", | 180 web_ui()->CallJavascriptFunction("cr.webUIListenerCallback", |
| 180 base::StringValue("signedin-users-received"), | 181 base::StringValue("signedin-users-received"), |
| 181 user_info_list); | 182 user_info_list); |
| 182 } | 183 } |
| 183 | 184 |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 DCHECK_EQ(SUPERVISED_PROFILE_IMPORT, profile_creation_type_); | 676 DCHECK_EQ(SUPERVISED_PROFILE_IMPORT, profile_creation_type_); |
| 676 UMA_HISTOGRAM_ENUMERATION("Profile.SupervisedProfileImportError", | 677 UMA_HISTOGRAM_ENUMERATION("Profile.SupervisedProfileImportError", |
| 677 error_state, GoogleServiceAuthError::NUM_STATES); | 678 error_state, GoogleServiceAuthError::NUM_STATES); |
| 678 UMA_HISTOGRAM_MEDIUM_TIMES( | 679 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 679 "Profile.SupervisedProfileTotalImportTime", | 680 "Profile.SupervisedProfileTotalImportTime", |
| 680 base::TimeTicks::Now() - profile_creation_start_time_); | 681 base::TimeTicks::Now() - profile_creation_start_time_); |
| 681 } | 682 } |
| 682 } | 683 } |
| 683 | 684 |
| 684 #endif | 685 #endif |
| OLD | NEW |