OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/login/managed/locally_managed_user_creation_sc
reen.h" | 5 #include "chrome/browser/chromeos/login/managed/locally_managed_user_creation_sc
reen.h" |
6 | 6 |
7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 image = selected_image_; | 203 image = selected_image_; |
204 controller_->SetUpCreation(display_name, managed_user_password, image); | 204 controller_->SetUpCreation(display_name, managed_user_password, image); |
205 controller_->StartCreation(); | 205 controller_->StartCreation(); |
206 } | 206 } |
207 | 207 |
208 void LocallyManagedUserCreationScreen::ImportManagedUser( | 208 void LocallyManagedUserCreationScreen::ImportManagedUser( |
209 const std::string& user_id) { | 209 const std::string& user_id) { |
210 DCHECK(controller_.get()); | 210 DCHECK(controller_.get()); |
211 DCHECK(existing_users_.get()); | 211 DCHECK(existing_users_.get()); |
212 VLOG(1) << "Importing user " << user_id; | 212 VLOG(1) << "Importing user " << user_id; |
213 DictionaryValue* user_info; | 213 base::DictionaryValue* user_info; |
214 if (!existing_users_->GetDictionary(user_id, &user_info)) { | 214 if (!existing_users_->GetDictionary(user_id, &user_info)) { |
215 LOG(ERROR) << "Can not import non-existing user " << user_id; | 215 LOG(ERROR) << "Can not import non-existing user " << user_id; |
216 return; | 216 return; |
217 } | 217 } |
218 base::string16 display_name; | 218 base::string16 display_name; |
219 std::string master_key; | 219 std::string master_key; |
220 std::string avatar; | 220 std::string avatar; |
221 bool exists; | 221 bool exists; |
222 int avatar_index = LocallyManagedUserCreationController::kDummyAvatarIndex; | 222 int avatar_index = LocallyManagedUserCreationController::kDummyAvatarIndex; |
223 user_info->GetString(ManagedUserSyncService::kName, &display_name); | 223 user_info->GetString(ManagedUserSyncService::kName, &display_name); |
(...skipping 23 matching lines...) Expand all Loading... |
247 } | 247 } |
248 | 248 |
249 // TODO(antrim): Code duplication with previous method will be removed once | 249 // TODO(antrim): Code duplication with previous method will be removed once |
250 // password sync is implemented. | 250 // password sync is implemented. |
251 void LocallyManagedUserCreationScreen::ImportManagedUserWithPassword( | 251 void LocallyManagedUserCreationScreen::ImportManagedUserWithPassword( |
252 const std::string& user_id, | 252 const std::string& user_id, |
253 const std::string& password) { | 253 const std::string& password) { |
254 DCHECK(controller_.get()); | 254 DCHECK(controller_.get()); |
255 DCHECK(existing_users_.get()); | 255 DCHECK(existing_users_.get()); |
256 VLOG(1) << "Importing user " << user_id; | 256 VLOG(1) << "Importing user " << user_id; |
257 DictionaryValue* user_info; | 257 base::DictionaryValue* user_info; |
258 if (!existing_users_->GetDictionary(user_id, &user_info)) { | 258 if (!existing_users_->GetDictionary(user_id, &user_info)) { |
259 LOG(ERROR) << "Can not import non-existing user " << user_id; | 259 LOG(ERROR) << "Can not import non-existing user " << user_id; |
260 return; | 260 return; |
261 } | 261 } |
262 base::string16 display_name; | 262 base::string16 display_name; |
263 std::string master_key; | 263 std::string master_key; |
264 std::string avatar; | 264 std::string avatar; |
265 bool exists; | 265 bool exists; |
266 int avatar_index = LocallyManagedUserCreationController::kDummyAvatarIndex; | 266 int avatar_index = LocallyManagedUserCreationController::kDummyAvatarIndex; |
267 user_info->GetString(ManagedUserSyncService::kName, &display_name); | 267 user_info->GetString(ManagedUserSyncService::kName, &display_name); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 selected_image_ = User::kExternalImageIndex; | 557 selected_image_ = User::kExternalImageIndex; |
558 } else { | 558 } else { |
559 NOTREACHED() << "Unexpected image type: " << image_type; | 559 NOTREACHED() << "Unexpected image type: " << image_type; |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 void LocallyManagedUserCreationScreen::OnImageAccepted() { | 563 void LocallyManagedUserCreationScreen::OnImageAccepted() { |
564 } | 564 } |
565 | 565 |
566 } // namespace chromeos | 566 } // namespace chromeos |
OLD | NEW |