Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / login / enrollment / enrollment_screen_actor.h
bloba2c4770f57ebef655e10e16ec6be8bbc43915337
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_ACTOR_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_ACTOR_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper.h"
13 class GoogleServiceAuthError;
15 namespace policy {
16 struct EnrollmentConfig;
17 class EnrollmentStatus;
20 namespace chromeos {
22 // Interface class for the enterprise enrollment screen actor.
23 class EnrollmentScreenActor {
24 public:
25 // This defines the interface for controllers which will be called back when
26 // something happens on the UI.
27 class Controller {
28 public:
29 virtual ~Controller() {}
31 virtual void OnLoginDone(const std::string& user,
32 const std::string& auth_code) = 0;
33 virtual void OnRetry() = 0;
34 virtual void OnCancel() = 0;
35 virtual void OnConfirmationClosed() = 0;
36 virtual void OnDeviceAttributeProvided(const std::string& asset_id,
37 const std::string& location) = 0;
40 virtual ~EnrollmentScreenActor() {}
42 // Initializes the actor with parameters.
43 virtual void SetParameters(Controller* controller,
44 const policy::EnrollmentConfig& config) = 0;
46 // Prepare the contents to showing.
47 virtual void PrepareToShow() = 0;
49 // Shows the contents of the screen.
50 virtual void Show() = 0;
52 // Hides the contents of the screen.
53 virtual void Hide() = 0;
55 // Shows the signin screen.
56 virtual void ShowSigninScreen() = 0;
58 // Shows the device attribute prompt screen.
59 virtual void ShowAttributePromptScreen(const std::string& asset_id,
60 const std::string& location) = 0;
62 // Shows the spinner screen for enrollment.
63 virtual void ShowEnrollmentSpinnerScreen() = 0;
65 // Show an authentication error.
66 virtual void ShowAuthError(const GoogleServiceAuthError& error) = 0;
68 // Show non-authentication error.
69 virtual void ShowOtherError(EnterpriseEnrollmentHelper::OtherError error) = 0;
71 // Update the UI to report the |status| of the enrollment procedure.
72 virtual void ShowEnrollmentStatus(policy::EnrollmentStatus status) = 0;
75 } // namespace chromeos
77 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ENROLLMENT_ENROLLMENT_SCREEN_ACTOR_H_