| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised/supervised_user_creation_scre
en.h" | 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre
en.h" |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | |
| 8 #include "ash/shell.h" | |
| 9 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
| 10 #include "base/values.h" | 8 #include "base/values.h" |
| 11 #include "chrome/browser/chromeos/camera_detector.h" | 9 #include "chrome/browser/chromeos/camera_detector.h" |
| 12 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" | 10 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" |
| 13 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 11 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 14 #include "chrome/browser/chromeos/login/screen_manager.h" | 12 #include "chrome/browser/chromeos/login/screen_manager.h" |
| 15 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 13 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
| 16 #include "chrome/browser/chromeos/login/screens/error_screen.h" | 14 #include "chrome/browser/chromeos/login/screens/error_screen.h" |
| 17 #include "chrome/browser/chromeos/login/signin_specifics.h" | 15 #include "chrome/browser/chromeos/login/signin_specifics.h" |
| 18 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" | 16 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 #include "chromeos/login/auth/key.h" | 30 #include "chromeos/login/auth/key.h" |
| 33 #include "chromeos/login/auth/user_context.h" | 31 #include "chromeos/login/auth/user_context.h" |
| 34 #include "chromeos/network/network_state.h" | 32 #include "chromeos/network/network_state.h" |
| 35 #include "components/user_manager/user.h" | 33 #include "components/user_manager/user.h" |
| 36 #include "components/user_manager/user_image/user_image.h" | 34 #include "components/user_manager/user_image/user_image.h" |
| 37 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
| 38 #include "third_party/skia/include/core/SkBitmap.h" | 36 #include "third_party/skia/include/core/SkBitmap.h" |
| 39 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 40 #include "ui/gfx/image/image_skia.h" | 38 #include "ui/gfx/image/image_skia.h" |
| 41 | 39 |
| 40 #if !defined(USE_ATHENA) |
| 41 #include "ash/desktop_background/desktop_background_controller.h" |
| 42 #include "ash/shell.h" |
| 43 #endif |
| 44 |
| 42 namespace chromeos { | 45 namespace chromeos { |
| 43 | 46 |
| 44 namespace { | 47 namespace { |
| 45 | 48 |
| 46 // Key for (boolean) value that indicates that user already exists on device. | 49 // Key for (boolean) value that indicates that user already exists on device. |
| 47 const char kUserExists[] = "exists"; | 50 const char kUserExists[] = "exists"; |
| 48 // Key for value that indicates why user can not be imported. | 51 // Key for value that indicates why user can not be imported. |
| 49 const char kUserConflict[] = "conflict"; | 52 const char kUserConflict[] = "conflict"; |
| 50 // User is already imported. | 53 // User is already imported. |
| 51 const char kUserConflictImported[] = "imported"; | 54 const char kUserConflictImported[] = "imported"; |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 if (actor_) | 355 if (actor_) |
| 353 actor_->ShowManagerPasswordError(); | 356 actor_->ShowManagerPasswordError(); |
| 354 } | 357 } |
| 355 | 358 |
| 356 void SupervisedUserCreationScreen::OnManagerFullyAuthenticated( | 359 void SupervisedUserCreationScreen::OnManagerFullyAuthenticated( |
| 357 Profile* manager_profile) { | 360 Profile* manager_profile) { |
| 358 manager_signin_in_progress_ = false; | 361 manager_signin_in_progress_ = false; |
| 359 DCHECK(controller_.get()); | 362 DCHECK(controller_.get()); |
| 360 // For manager user, move desktop to locked container so that windows created | 363 // For manager user, move desktop to locked container so that windows created |
| 361 // during the user image picker step are below it. | 364 // during the user image picker step are below it. |
| 365 #if !defined(USE_ATHENA) |
| 362 ash::Shell::GetInstance()-> | 366 ash::Shell::GetInstance()-> |
| 363 desktop_background_controller()->MoveDesktopToLockedContainer(); | 367 desktop_background_controller()->MoveDesktopToLockedContainer(); |
| 368 #endif |
| 364 | 369 |
| 365 controller_->SetManagerProfile(manager_profile); | 370 controller_->SetManagerProfile(manager_profile); |
| 366 if (actor_) | 371 if (actor_) |
| 367 actor_->ShowUsernamePage(); | 372 actor_->ShowUsernamePage(); |
| 368 | 373 |
| 369 last_page_ = kNameOfNewUserParametersScreen; | 374 last_page_ = kNameOfNewUserParametersScreen; |
| 370 CHECK(!sync_service_); | 375 CHECK(!sync_service_); |
| 371 sync_service_ = SupervisedUserSyncServiceFactory::GetForProfile( | 376 sync_service_ = SupervisedUserSyncServiceFactory::GetForProfile( |
| 372 manager_profile); | 377 manager_profile); |
| 373 sync_service_->AddObserver(this); | 378 sync_service_->AddObserver(this); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 selected_image_ = user_manager::User::USER_IMAGE_EXTERNAL; | 624 selected_image_ = user_manager::User::USER_IMAGE_EXTERNAL; |
| 620 } else { | 625 } else { |
| 621 NOTREACHED() << "Unexpected image type: " << image_type; | 626 NOTREACHED() << "Unexpected image type: " << image_type; |
| 622 } | 627 } |
| 623 } | 628 } |
| 624 | 629 |
| 625 void SupervisedUserCreationScreen::OnImageAccepted() { | 630 void SupervisedUserCreationScreen::OnImageAccepted() { |
| 626 } | 631 } |
| 627 | 632 |
| 628 } // namespace chromeos | 633 } // namespace chromeos |
| OLD | NEW |