Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4303)

Unified Diff: chrome/browser/chromeos/login/arc_kiosk_controller.h

Issue 2649103006: arc: Add splash screen for ARC++ Kiosk startup (Closed)
Patch Set: achuithb@ comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/arc_kiosk_controller.h
diff --git a/chrome/browser/chromeos/login/arc_kiosk_controller.h b/chrome/browser/chromeos/login/arc_kiosk_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..50628369f41a6e2bebb73385e00fd94e7843aae4
--- /dev/null
+++ b/chrome/browser/chromeos/login/arc_kiosk_controller.h
@@ -0,0 +1,84 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_ARC_KIOSK_CONTROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_ARC_KIOSK_CONTROLLER_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.h"
+#include "chrome/browser/chromeos/login/screens/arc_kiosk_splash_screen_actor.h"
+#include "chrome/browser/chromeos/login/session/user_session_manager.h"
+#include "chromeos/login/auth/login_performer.h"
+
+class AccountId;
+class Profile;
+
+namespace base {
+class OneShotTimer;
+}
+
+namespace chromeos {
+
+class LoginDisplayHost;
+class OobeUI;
+class UserContext;
+
+// Controller for the ARC kiosk launch process, responsible for
+// coordinating loading the ARC kiosk profile, and
+// updating the splash screen UI.
+class ArcKioskController : public LoginPerformer::Delegate,
+ public UserSessionManagerDelegate,
+ public ArcKioskAppService::Delegate,
+ public ArcKioskSplashScreenActor::Delegate {
+ public:
+ ArcKioskController(LoginDisplayHost* host, OobeUI* oobe_ui);
+
+ ~ArcKioskController() override;
+
+ // Starts ARC kiosk splash screen.
+ void StartArcKiosk(const AccountId& account_id);
+
+ private:
+ void CleanUp();
+ void CloseSplashScreen();
+
+ // LoginPerformer::Delegate implementation:
+ void OnAuthFailure(const AuthFailure& error) override;
+ void OnAuthSuccess(const UserContext& user_context) override;
+ void WhiteListCheckFailed(const std::string& email) override;
+ void PolicyLoadFailed() override;
+ void SetAuthFlowOffline(bool offline) override;
+
+ // UserSessionManagerDelegate implementation:
+ void OnProfilePrepared(Profile* profile, bool browser_launched) override;
+
+ // ArcKioskAppService::Delegate implementation:
+ void OnAppStarted() override;
+ void OnAppWindowLaunched() override;
+
+ // ArcKioskSplashScreenActor::Delegate implementation:
+ void OnCancelArcKioskLaunch() override;
+
+ // LoginDisplayHost owns itself.
+ LoginDisplayHost* const host_;
+ // Owned by OobeUI.
+ ArcKioskSplashScreenActor* const arc_kiosk_splash_screen_actor_;
+ // Not owning here.
+ Profile* profile_ = nullptr;
+
+ // Used to execute login operations.
+ std::unique_ptr<LoginPerformer> login_performer_ = nullptr;
+
+ // A timer to ensure the app splash is shown for a minimum amount of time.
+ base::OneShotTimer splash_wait_timer_;
+ bool launched_ = false;
+ base::WeakPtrFactory<ArcKioskController> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcKioskController);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_ARC_KIOSK_CONTROLLER_H_
« no previous file with comments | « chrome/browser/chromeos/arc/arc_session_manager_unittest.cc ('k') | chrome/browser/chromeos/login/arc_kiosk_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698