| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 web_ui()->CallJavascriptFunction("cr.webUIListenerCallback", | 147 web_ui()->CallJavascriptFunction("cr.webUIListenerCallback", |
| 148 base::StringValue("profile-icons-received"), | 148 base::StringValue("profile-icons-received"), |
| 149 image_url_list); | 149 image_url_list); |
| 150 | 150 |
| 151 SendNewProfileDefaults(); | 151 SendNewProfileDefaults(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void SigninCreateProfileHandler::SendNewProfileDefaults() { | 154 void SigninCreateProfileHandler::SendNewProfileDefaults() { |
| 155 ProfileAttributesStorage& storage = | 155 ProfileInfoCache& cache = |
| 156 g_browser_process->profile_manager()->GetProfileAttributesStorage(); | 156 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 157 base::DictionaryValue profile_info; | 157 base::DictionaryValue profile_info; |
| 158 profile_info.SetString("name", storage.ChooseNameForNewProfile(0)); | 158 profile_info.SetString("name", cache.ChooseNameForNewProfile(0)); |
| 159 | 159 |
| 160 web_ui()->CallJavascriptFunction( | 160 web_ui()->CallJavascriptFunction( |
| 161 "cr.webUIListenerCallback", | 161 "cr.webUIListenerCallback", |
| 162 base::StringValue("profile-defaults-received"), | 162 base::StringValue("profile-defaults-received"), |
| 163 profile_info); | 163 profile_info); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void SigninCreateProfileHandler::RequestSignedInProfiles( | 166 void SigninCreateProfileHandler::RequestSignedInProfiles( |
| 167 const base::ListValue* args) { | 167 const base::ListValue* args) { |
| 168 base::ListValue user_info_list; | 168 base::ListValue user_info_list; |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 DCHECK_EQ(SUPERVISED_PROFILE_IMPORT, profile_creation_type_); | 685 DCHECK_EQ(SUPERVISED_PROFILE_IMPORT, profile_creation_type_); |
| 686 UMA_HISTOGRAM_ENUMERATION("Profile.SupervisedProfileImportError", | 686 UMA_HISTOGRAM_ENUMERATION("Profile.SupervisedProfileImportError", |
| 687 error_state, GoogleServiceAuthError::NUM_STATES); | 687 error_state, GoogleServiceAuthError::NUM_STATES); |
| 688 UMA_HISTOGRAM_MEDIUM_TIMES( | 688 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 689 "Profile.SupervisedProfileTotalImportTime", | 689 "Profile.SupervisedProfileTotalImportTime", |
| 690 base::TimeTicks::Now() - profile_creation_start_time_); | 690 base::TimeTicks::Now() - profile_creation_start_time_); |
| 691 } | 691 } |
| 692 } | 692 } |
| 693 | 693 |
| 694 #endif | 694 #endif |
| OLD | NEW |