Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / kiosk_autolaunch_screen_handler.h
blob63b826d994d3c51e81e68da7872d47ce8fb5f2bb
1 // Copyright 2013 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_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_AUTOLAUNCH_SCREEN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_AUTOLAUNCH_SCREEN_HANDLER_H_
8 #include "base/compiler_specific.h"
9 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h"
10 #include "chrome/browser/chromeos/login/screens/kiosk_autolaunch_screen_actor.h"
11 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
12 #include "content/public/browser/web_ui.h"
14 namespace chromeos {
16 // WebUI implementation of KioskAutolaunchScreenActor.
17 class KioskAutolaunchScreenHandler : public KioskAutolaunchScreenActor,
18 public KioskAppManagerObserver,
19 public BaseScreenHandler {
20 public:
21 KioskAutolaunchScreenHandler();
22 ~KioskAutolaunchScreenHandler() override;
24 // KioskAutolaunchScreenActor implementation:
25 void Show() override;
26 void SetDelegate(Delegate* delegate) override;
28 // KioskAppManagerObserver overrides:
29 void OnKioskAppsSettingsChanged() override;
30 void OnKioskAppDataChanged(const std::string& app_id) override;
32 // BaseScreenHandler implementation:
33 void DeclareLocalizedValues(
34 ::login::LocalizedValuesBuilder* builder) override;
35 void Initialize() override;
37 // WebUIMessageHandler implementation:
38 void RegisterMessages() override;
40 private:
41 // Updates auto-start UI assets on JS side.
42 void UpdateKioskApp();
44 // JS messages handlers.
45 void HandleOnCancel();
46 void HandleOnConfirm();
47 void HandleOnVisible();
49 Delegate* delegate_;
51 // Keeps whether screen should be shown right after initialization.
52 bool show_on_init_;
53 bool is_visible_;
55 DISALLOW_COPY_AND_ASSIGN(KioskAutolaunchScreenHandler);
58 } // namespace chromeos
60 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_AUTOLAUNCH_SCREEN_HANDLER_H_