| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_SCRE
EN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_SCRE
EN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_SCRE
EN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_SCRE
EN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/chromeos/camera_presence_notifier.h" |
| 12 #include "chrome/browser/chromeos/login/managed/managed_user_creation_controller
.h" | 13 #include "chrome/browser/chromeos/login/managed/managed_user_creation_controller
.h" |
| 13 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" | 14 #include "chrome/browser/chromeos/login/screens/wizard_screen.h" |
| 14 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 15 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 15 #include "chrome/browser/image_decoder.h" | 16 #include "chrome/browser/image_decoder.h" |
| 16 #include "chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_s
creen_handler.h" | 17 #include "chrome/browser/ui/webui/chromeos/login/locally_managed_user_creation_s
creen_handler.h" |
| 17 #include "ui/gfx/image/image_skia.h" | 18 #include "ui/gfx/image/image_skia.h" |
| 18 | 19 |
| 19 class Profile; | 20 class Profile; |
| 20 | 21 |
| 21 namespace chromeos { | 22 namespace chromeos { |
| 22 | 23 |
| 23 class NetworkState; | 24 class NetworkState; |
| 24 | 25 |
| 25 // Class that controls screen showing ui for locally managed user creation. | 26 // Class that controls screen showing ui for locally managed user creation. |
| 26 class LocallyManagedUserCreationScreen | 27 class LocallyManagedUserCreationScreen |
| 27 : public WizardScreen, | 28 : public WizardScreen, |
| 28 public LocallyManagedUserCreationScreenHandler::Delegate, | 29 public LocallyManagedUserCreationScreenHandler::Delegate, |
| 29 public ManagedUserCreationController::StatusConsumer, | 30 public ManagedUserCreationController::StatusConsumer, |
| 30 public ImageDecoder::Delegate, | 31 public ImageDecoder::Delegate, |
| 31 public NetworkPortalDetector::Observer { | 32 public NetworkPortalDetector::Observer, |
| 33 public CameraPresenceNotifier::Observer { |
| 32 public: | 34 public: |
| 33 LocallyManagedUserCreationScreen( | 35 LocallyManagedUserCreationScreen( |
| 34 ScreenObserver* observer, | 36 ScreenObserver* observer, |
| 35 LocallyManagedUserCreationScreenHandler* actor); | 37 LocallyManagedUserCreationScreenHandler* actor); |
| 36 virtual ~LocallyManagedUserCreationScreen(); | 38 virtual ~LocallyManagedUserCreationScreen(); |
| 37 | 39 |
| 38 // Makes screen to show message about inconsistency in manager login flow | 40 // Makes screen to show message about inconsistency in manager login flow |
| 39 // (e.g. password change detected, invalid OAuth token, etc). | 41 // (e.g. password change detected, invalid OAuth token, etc). |
| 40 // Called when manager user is successfully authenticated, so ui elements | 42 // Called when manager user is successfully authenticated, so ui elements |
| 41 // should result in forced logout. | 43 // should result in forced logout. |
| 42 void ShowManagerInconsistentStateErrorScreen(); | 44 void ShowManagerInconsistentStateErrorScreen(); |
| 43 | 45 |
| 44 // Called when authentication fails for manager with provided password. | 46 // Called when authentication fails for manager with provided password. |
| 45 // Displays wrong password message on manager selection screen. | 47 // Displays wrong password message on manager selection screen. |
| 46 void OnManagerLoginFailure(); | 48 void OnManagerLoginFailure(); |
| 47 | 49 |
| 48 // Called when manager is successfully authenticated and account is in | 50 // Called when manager is successfully authenticated and account is in |
| 49 // consistent state. | 51 // consistent state. |
| 50 void OnManagerFullyAuthenticated(Profile* manager_profile); | 52 void OnManagerFullyAuthenticated(Profile* manager_profile); |
| 51 | 53 |
| 52 // Called when manager is successfully authenticated against cryptohome, but | 54 // Called when manager is successfully authenticated against cryptohome, but |
| 53 // OAUTH token validation hasn't completed yet. | 55 // OAUTH token validation hasn't completed yet. |
| 54 // Results in spinner indicating that creation is in process. | 56 // Results in spinner indicating that creation is in process. |
| 55 void OnManagerCryptohomeAuthenticated(); | 57 void OnManagerCryptohomeAuthenticated(); |
| 56 | 58 |
| 57 // Shows initial screen where managed user name/password are defined and | 59 // Shows initial screen where managed user name/password are defined and |
| 58 // manager is selected. | 60 // manager is selected. |
| 59 void ShowInitialScreen(); | 61 void ShowInitialScreen(); |
| 60 | 62 |
| 63 // CameraPresenceNotifier::Observer implementation: |
| 64 virtual void OnCameraPresenceCheckDone(bool is_camera_present) OVERRIDE; |
| 65 |
| 61 // WizardScreen implementation: | 66 // WizardScreen implementation: |
| 62 virtual void PrepareToShow() OVERRIDE; | 67 virtual void PrepareToShow() OVERRIDE; |
| 63 virtual void Show() OVERRIDE; | 68 virtual void Show() OVERRIDE; |
| 64 virtual void Hide() OVERRIDE; | 69 virtual void Hide() OVERRIDE; |
| 65 virtual std::string GetName() const OVERRIDE; | 70 virtual std::string GetName() const OVERRIDE; |
| 66 | 71 |
| 67 // LocallyManagedUserCreationScreenHandler::Delegate implementation: | 72 // LocallyManagedUserCreationScreenHandler::Delegate implementation: |
| 68 virtual void OnActorDestroyed(LocallyManagedUserCreationScreenHandler* actor) | 73 virtual void OnActorDestroyed(LocallyManagedUserCreationScreenHandler* actor) |
| 69 OVERRIDE; | 74 OVERRIDE; |
| 70 virtual void CreateManagedUser( | 75 virtual void CreateManagedUser( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 92 | 97 |
| 93 // NetworkPortalDetector::Observer implementation: | 98 // NetworkPortalDetector::Observer implementation: |
| 94 virtual void OnPortalDetectionCompleted( | 99 virtual void OnPortalDetectionCompleted( |
| 95 const NetworkState* network, | 100 const NetworkState* network, |
| 96 const NetworkPortalDetector::CaptivePortalState& state) OVERRIDE; | 101 const NetworkPortalDetector::CaptivePortalState& state) OVERRIDE; |
| 97 | 102 |
| 98 // TODO(antrim) : this is an explicit code duplications with UserImageScreen. | 103 // TODO(antrim) : this is an explicit code duplications with UserImageScreen. |
| 99 // It should be removed by issue 251179. | 104 // It should be removed by issue 251179. |
| 100 | 105 |
| 101 // LocallyManagedUserCreationScreenHandler::Delegate (image) implementation: | 106 // LocallyManagedUserCreationScreenHandler::Delegate (image) implementation: |
| 102 virtual void OnCameraPresenceCheckDone(bool is_camera_present) OVERRIDE; | |
| 103 virtual void OnPhotoTaken(const std::string& raw_data) OVERRIDE; | 107 virtual void OnPhotoTaken(const std::string& raw_data) OVERRIDE; |
| 104 virtual void OnImageSelected(const std::string& image_url, | 108 virtual void OnImageSelected(const std::string& image_url, |
| 105 const std::string& image_type) OVERRIDE; | 109 const std::string& image_type) OVERRIDE; |
| 106 virtual void OnImageAccepted() OVERRIDE; | 110 virtual void OnImageAccepted() OVERRIDE; |
| 107 // ImageDecoder::Delegate overrides: | 111 // ImageDecoder::Delegate overrides: |
| 108 virtual void OnImageDecoded(const ImageDecoder* decoder, | 112 virtual void OnImageDecoded(const ImageDecoder* decoder, |
| 109 const SkBitmap& decoded_image) OVERRIDE; | 113 const SkBitmap& decoded_image) OVERRIDE; |
| 110 virtual void OnDecodeImageFailed(const ImageDecoder* decoder) OVERRIDE; | 114 virtual void OnDecodeImageFailed(const ImageDecoder* decoder) OVERRIDE; |
| 111 | 115 |
| 112 private: | 116 private: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 127 bool apply_photo_after_decoding_; | 131 bool apply_photo_after_decoding_; |
| 128 int selected_image_; | 132 int selected_image_; |
| 129 | 133 |
| 130 DISALLOW_COPY_AND_ASSIGN(LocallyManagedUserCreationScreen); | 134 DISALLOW_COPY_AND_ASSIGN(LocallyManagedUserCreationScreen); |
| 131 }; | 135 }; |
| 132 | 136 |
| 133 } // namespace chromeos | 137 } // namespace chromeos |
| 134 | 138 |
| 135 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_S
CREEN_H_ | 139 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MANAGED_LOCALLY_MANAGED_USER_CREATION_S
CREEN_H_ |
| 136 | 140 |
| OLD | NEW |