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_
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"
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
{
25 KioskAppMenuHandler();
26 virtual ~KioskAppMenuHandler();
28 void GetLocalizedStrings(base::DictionaryValue
* localized_strings
);
30 // content::WebUIMessageHandler overrides:
31 virtual void RegisterMessages() OVERRIDE
;
34 // Sends all kiosk apps to webui.
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
);
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_