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