Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / kiosk_app_menu_handler.h
blob36460585c00dcaa124a10dd601bddd547874df4e
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_APP_MENU_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_APP_MENU_HANDLER_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
14 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h"
15 #include "content/public/browser/web_ui_message_handler.h"
17 namespace chromeos {
19 // KioskAppMenuHandler supplies kiosk apps data to apps menu on sign-in
20 // screen when app mode is enabled and handles "launchKioskApp" request
21 // from the apps menu.
22 class KioskAppMenuHandler : public content::WebUIMessageHandler,
23 public KioskAppManagerObserver {
24 public:
25 KioskAppMenuHandler();
26 virtual ~KioskAppMenuHandler();
28 void GetLocalizedStrings(base::DictionaryValue* localized_strings);
30 // content::WebUIMessageHandler overrides:
31 virtual void RegisterMessages() OVERRIDE;
33 private:
34 // Sends all kiosk apps to webui.
35 void SendKioskApps();
37 // JS callbacks.
38 void HandleInitializeKioskApps(const base::ListValue* args);
39 void HandleKioskAppsLoaded(const base::ListValue* args);
40 void HandleCheckKioskAppLaunchError(const base::ListValue* args);
42 // KioskAppManagerObserver overrides:
43 virtual void OnKioskAppsSettingsChanged() OVERRIDE;
44 virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE;
46 // Callback for KioskAppManager::GetConsumerKioskModeStatus().
47 void OnGetConsumerKioskModeStatus(
48 KioskAppManager::ConsumerKioskModeStatus status);
50 bool initialized_;
51 base::WeakPtrFactory<KioskAppMenuHandler> weak_ptr_factory_;
53 DISALLOW_COPY_AND_ASSIGN(KioskAppMenuHandler);
56 } // namespace chromeos
58 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_APP_MENU_HANDLER_H_