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

Side by Side Diff: chrome/browser/ui/webui/options/create_profile_handler.cc

Issue 2516613002: Profile deletion: prevent profile creation race in dying browser. (Closed)
Patch Set: Review fixes Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/lifetime/keep_alive_types.cc ('k') | chrome/browser/ui/webui/profile_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/options/create_profile_handler.h" 5 #include "chrome/browser/ui/webui/options/create_profile_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // the new window now. 211 // the new window now.
212 bool should_open_new_window = true; 212 bool should_open_new_window = true;
213 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) 213 #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
214 if (profile_creation_type_ == SUPERVISED_PROFILE_CREATION) 214 if (profile_creation_type_ == SUPERVISED_PROFILE_CREATION)
215 should_open_new_window = false; 215 should_open_new_window = false;
216 #endif 216 #endif
217 217
218 if (should_open_new_window) { 218 if (should_open_new_window) {
219 // Opening the new window must be the last action, after all callbacks 219 // Opening the new window must be the last action, after all callbacks
220 // have been run, to give them a chance to initialize the profile. 220 // have been run, to give them a chance to initialize the profile.
221 webui::OpenNewWindowForProfile(profile, Profile::CREATE_STATUS_INITIALIZED); 221 webui::OpenNewWindowForProfile(profile);
222 } 222 }
223 profile_creation_type_ = NO_CREATION_IN_PROGRESS; 223 profile_creation_type_ = NO_CREATION_IN_PROGRESS;
224 } 224 }
225 225
226 void CreateProfileHandler::ShowProfileCreationError( 226 void CreateProfileHandler::ShowProfileCreationError(
227 Profile* profile, 227 Profile* profile,
228 const base::string16& error) { 228 const base::string16& error) {
229 DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_); 229 DCHECK_NE(NO_CREATION_IN_PROGRESS, profile_creation_type_);
230 profile_creation_type_ = NO_CREATION_IN_PROGRESS; 230 profile_creation_type_ = NO_CREATION_IN_PROGRESS;
231 profile_path_being_created_.clear(); 231 profile_path_being_created_.clear();
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 GetProfileAttributesStorage().GetAllProfilesAttributes(); 475 GetProfileAttributesStorage().GetAllProfilesAttributes();
476 for (const ProfileAttributesEntry* entry : entries) { 476 for (const ProfileAttributesEntry* entry : entries) {
477 if (existing_supervised_user_id == entry->GetSupervisedUserId()) 477 if (existing_supervised_user_id == entry->GetSupervisedUserId())
478 return false; 478 return false;
479 } 479 }
480 return true; 480 return true;
481 } 481 }
482 #endif 482 #endif
483 483
484 } // namespace options 484 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/keep_alive_types.cc ('k') | chrome/browser/ui/webui/profile_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698