Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / kiosk_enable_screen_handler.h
blob4926967edd3f4235c1b5890934889d1ba6aa7a6e
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_ENABLE_SCREEN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_ENABLE_SCREEN_HANDLER_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
11 #include "chrome/browser/chromeos/login/screens/kiosk_enable_screen_actor.h"
12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
14 namespace chromeos {
16 // WebUI implementation of KioskEnableScreenActor.
17 class KioskEnableScreenHandler : public KioskEnableScreenActor,
18 public BaseScreenHandler {
19 public:
20 KioskEnableScreenHandler();
21 ~KioskEnableScreenHandler() override;
23 // KioskEnableScreenActor implementation:
24 void Show() override;
25 void SetDelegate(Delegate* delegate) override;
27 // BaseScreenHandler implementation:
28 void DeclareLocalizedValues(
29 ::login::LocalizedValuesBuilder* builder) override;
30 void Initialize() override;
32 // WebUIMessageHandler implementation:
33 void RegisterMessages() override;
35 private:
36 // JS messages handlers.
37 void HandleOnClose();
38 void HandleOnEnable();
40 // Callback for KioskAppManager::EnableConsumerModeKiosk().
41 void OnEnableConsumerKioskAutoLaunch(bool success);
43 // Callback for KioskAppManager::GetConsumerKioskModeStatus().
44 void OnGetConsumerKioskAutoLaunchStatus(
45 KioskAppManager::ConsumerKioskAutoLaunchStatus status);
47 Delegate* delegate_;
49 // Keeps whether screen should be shown right after initialization.
50 bool show_on_init_;
52 // True if machine's consumer kiosk mode is in a configurable state.
53 bool is_configurable_;
55 base::WeakPtrFactory<KioskEnableScreenHandler> weak_ptr_factory_;
57 DISALLOW_COPY_AND_ASSIGN(KioskEnableScreenHandler);
60 } // namespace chromeos
62 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_ENABLE_SCREEN_HANDLER_H_