Chromium Code Reviews| 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 "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.h" | |
| 10 #include "chrome/browser/chromeos/login/screens/arc_kiosk_splash_screen_actor.h" | |
| 11 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | |
| 12 #include "chromeos/login/auth/login_performer.h" | |
| 13 | |
| 14 class AccountId; | |
| 15 class Profile; | |
| 16 | |
| 17 namespace base { | |
| 18 class OneShotTimer; | |
| 19 class TimeTicks; | |
| 20 } | |
| 
 
Luis Héctor Chávez
2017/01/26 17:37:45
nit:  // namespace base
 
Sergey Poromov
2017/01/26 18:30:22
Done.
 
 | |
| 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 base::TimeTicks launch_splash_start_time_; | |
| 77 | |
| 78 DISALLOW_COPY_AND_ASSIGN(ArcKioskController); | |
| 79 }; | |
| 80 | |
| 81 } // namespace chromeos | |
| 82 | |
| 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_ARC_KIOSK_CONTROLLER_H_ | |
| OLD | NEW |