Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: chrome/browser/ui/webui/signin/signin_create_profile_handler.cc

Issue 1794353003: Refactor ProfileInfoCache in c/b/profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a bug that causes unit tests without debug code to fail. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profiles_state.cc ('k') | chrome/browser/ui/webui/signin/signin_create_profile_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698