OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/login/managed/locally_managed_user_creation_co
ntroller.h" | 5 #include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_co
ntroller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 creation_context_.reset( | 77 creation_context_.reset( |
78 new LocallyManagedUserCreationController::UserCreationContext()); | 78 new LocallyManagedUserCreationController::UserCreationContext()); |
79 creation_context_->manager_id = manager_id; | 79 creation_context_->manager_id = manager_id; |
80 } | 80 } |
81 | 81 |
82 LocallyManagedUserCreationController::~LocallyManagedUserCreationController() { | 82 LocallyManagedUserCreationController::~LocallyManagedUserCreationController() { |
83 current_controller_ = NULL; | 83 current_controller_ = NULL; |
84 } | 84 } |
85 | 85 |
86 void LocallyManagedUserCreationController::SetUpCreation( | 86 void LocallyManagedUserCreationController::SetUpCreation( |
87 const string16& display_name, | 87 const base::string16& display_name, |
88 const std::string& password, | 88 const std::string& password, |
89 int avatar_index) { | 89 int avatar_index) { |
90 DCHECK(creation_context_); | 90 DCHECK(creation_context_); |
91 creation_context_->display_name = display_name; | 91 creation_context_->display_name = display_name; |
92 creation_context_->password = password; | 92 creation_context_->password = password; |
93 creation_context_->avatar_index = avatar_index; | 93 creation_context_->avatar_index = avatar_index; |
94 } | 94 } |
95 | 95 |
96 void LocallyManagedUserCreationController::StartImport( | 96 void LocallyManagedUserCreationController::StartImport( |
97 const string16& display_name, | 97 const base::string16& display_name, |
98 const std::string& password, | 98 const std::string& password, |
99 int avatar_index, | 99 int avatar_index, |
100 const std::string& sync_id, | 100 const std::string& sync_id, |
101 const std::string& master_key) { | 101 const std::string& master_key) { |
102 DCHECK(creation_context_); | 102 DCHECK(creation_context_); |
103 creation_context_->creation_type = USER_IMPORT; | 103 creation_context_->creation_type = USER_IMPORT; |
104 creation_context_->display_name = display_name; | 104 creation_context_->display_name = display_name; |
105 creation_context_->password = password; | 105 creation_context_->password = password; |
106 creation_context_->avatar_index = avatar_index; | 106 creation_context_->avatar_index = avatar_index; |
107 creation_context_->sync_user_id = sync_id; | 107 creation_context_->sync_user_id = sync_id; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 // sync service fails to use it. | 280 // sync service fails to use it. |
281 UserManager::Get()->SaveUserOAuthStatus(creation_context_->local_user_id, | 281 UserManager::Get()->SaveUserOAuthStatus(creation_context_->local_user_id, |
282 User::OAUTH2_TOKEN_STATUS_VALID); | 282 User::OAUTH2_TOKEN_STATUS_VALID); |
283 UserManager::Get()->GetSupervisedUserManager()-> | 283 UserManager::Get()->GetSupervisedUserManager()-> |
284 CommitCreationTransaction(); | 284 CommitCreationTransaction(); |
285 if (consumer_) | 285 if (consumer_) |
286 consumer_->OnCreationSuccess(); | 286 consumer_->OnCreationSuccess(); |
287 } | 287 } |
288 | 288 |
289 } // namespace chromeos | 289 } // namespace chromeos |
OLD | NEW |