| OLD | NEW | 
| (Empty) |  | 
 |   1 // Copyright 2017 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. | 
 |   4  | 
 |   5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ARC_KIOSK_CONTROLLER_H_ | 
 |   6 #define CHROME_BROWSER_CHROMEOS_LOGIN_ARC_KIOSK_CONTROLLER_H_ | 
 |   7  | 
 |   8 #include "base/macros.h" | 
 |   9 #include "base/memory/weak_ptr.h" | 
 |  10 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.h" | 
 |  11 #include "chrome/browser/chromeos/login/screens/arc_kiosk_splash_screen_actor.h" | 
 |  12 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 
 |  13 #include "chromeos/login/auth/login_performer.h" | 
 |  14  | 
 |  15 class AccountId; | 
 |  16 class Profile; | 
 |  17  | 
 |  18 namespace base { | 
 |  19 class OneShotTimer; | 
 |  20 } | 
 |  21  | 
 |  22 namespace chromeos { | 
 |  23  | 
 |  24 class LoginDisplayHost; | 
 |  25 class OobeUI; | 
 |  26 class UserContext; | 
 |  27  | 
 |  28 // Controller for the ARC kiosk launch process, responsible for | 
 |  29 // coordinating loading the ARC kiosk profile, and | 
 |  30 // updating the splash screen UI. | 
 |  31 class ArcKioskController : public LoginPerformer::Delegate, | 
 |  32                            public UserSessionManagerDelegate, | 
 |  33                            public ArcKioskAppService::Delegate, | 
 |  34                            public ArcKioskSplashScreenActor::Delegate { | 
 |  35  public: | 
 |  36   ArcKioskController(LoginDisplayHost* host, OobeUI* oobe_ui); | 
 |  37  | 
 |  38   ~ArcKioskController() override; | 
 |  39  | 
 |  40   // Starts ARC kiosk splash screen. | 
 |  41   void StartArcKiosk(const AccountId& account_id); | 
 |  42  | 
 |  43  private: | 
 |  44   void CleanUp(); | 
 |  45   void CloseSplashScreen(); | 
 |  46  | 
 |  47   // LoginPerformer::Delegate implementation: | 
 |  48   void OnAuthFailure(const AuthFailure& error) override; | 
 |  49   void OnAuthSuccess(const UserContext& user_context) override; | 
 |  50   void WhiteListCheckFailed(const std::string& email) override; | 
 |  51   void PolicyLoadFailed() override; | 
 |  52   void SetAuthFlowOffline(bool offline) override; | 
 |  53  | 
 |  54   // UserSessionManagerDelegate implementation: | 
 |  55   void OnProfilePrepared(Profile* profile, bool browser_launched) override; | 
 |  56  | 
 |  57   // ArcKioskAppService::Delegate implementation: | 
 |  58   void OnAppStarted() override; | 
 |  59   void OnAppWindowLaunched() override; | 
 |  60  | 
 |  61   // ArcKioskSplashScreenActor::Delegate implementation: | 
 |  62   void OnCancelArcKioskLaunch() override; | 
 |  63  | 
 |  64   // LoginDisplayHost owns itself. | 
 |  65   LoginDisplayHost* const host_; | 
 |  66   // Owned by OobeUI. | 
 |  67   ArcKioskSplashScreenActor* const arc_kiosk_splash_screen_actor_; | 
 |  68   // Not owning here. | 
 |  69   Profile* profile_ = nullptr; | 
 |  70  | 
 |  71   // Used to execute login operations. | 
 |  72   std::unique_ptr<LoginPerformer> login_performer_ = nullptr; | 
 |  73  | 
 |  74   // A timer to ensure the app splash is shown for a minimum amount of time. | 
 |  75   base::OneShotTimer splash_wait_timer_; | 
 |  76   bool launched_ = false; | 
 |  77   base::WeakPtrFactory<ArcKioskController> weak_ptr_factory_; | 
 |  78  | 
 |  79   DISALLOW_COPY_AND_ASSIGN(ArcKioskController); | 
 |  80 }; | 
 |  81  | 
 |  82 }  // namespace chromeos | 
 |  83  | 
 |  84 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_ARC_KIOSK_CONTROLLER_H_ | 
| OLD | NEW |