OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_APP_MENU_HANDLER_H_ | 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_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_APP_MENU_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/public/browser/notification_observer.h" | 12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" |
13 #include "content/public/browser/web_ui_message_handler.h" | 13 #include "content/public/browser/web_ui_message_handler.h" |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 // KioskAppMenuHandler supplies kiosk apps data to apps menu on sign-in | 17 // KioskAppMenuHandler supplies kiosk apps data to apps menu on sign-in |
18 // screen when app mode is enabled and handles "launchKioskApp" request | 18 // screen when app mode is enabled and handles "launchKioskApp" request |
19 // from the apps menu. | 19 // from the apps menu. |
20 class KioskAppMenuHandler : public content::WebUIMessageHandler, | 20 class KioskAppMenuHandler : public content::WebUIMessageHandler, |
21 public content::NotificationObserver { | 21 public KioskAppManagerObserver { |
22 public: | 22 public: |
23 KioskAppMenuHandler(); | 23 KioskAppMenuHandler(); |
24 virtual ~KioskAppMenuHandler(); | 24 virtual ~KioskAppMenuHandler(); |
25 | 25 |
26 void GetLocalizedStrings(base::DictionaryValue* localized_strings); | 26 void GetLocalizedStrings(base::DictionaryValue* localized_strings); |
27 | 27 |
28 // content::WebUIMessageHandler overrides: | 28 // content::WebUIMessageHandler overrides: |
29 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() OVERRIDE; |
30 | 30 |
31 private: | 31 private: |
32 // Sends all kiosk apps to webui. | 32 // Sends all kiosk apps to webui. |
33 void SendKioskApps(); | 33 void SendKioskApps(); |
34 | 34 |
35 // JS callbacks. | 35 // JS callbacks. |
36 void HandleInitializeKioskApps(const base::ListValue* args); | 36 void HandleInitializeKioskApps(const base::ListValue* args); |
37 void HandleKioskAppsLoaded(const base::ListValue* args); | 37 void HandleKioskAppsLoaded(const base::ListValue* args); |
38 void HandleLaunchKioskApps(const base::ListValue* args); | 38 void HandleLaunchKioskApps(const base::ListValue* args); |
39 void HandleCheckKioskAppLaunchError(const base::ListValue* args); | 39 void HandleCheckKioskAppLaunchError(const base::ListValue* args); |
40 | 40 |
41 // content::NotificationObserver overrides: | 41 // KioskAppManagerObserver overrides: |
42 virtual void Observe(int type, | 42 virtual void OnKioskAppsSettingsChanged() OVERRIDE; |
43 const content::NotificationSource& source, | 43 virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE; |
44 const content::NotificationDetails& details) OVERRIDE; | |
45 | 44 |
46 bool initialized_; | 45 bool initialized_; |
47 | 46 |
48 DISALLOW_COPY_AND_ASSIGN(KioskAppMenuHandler); | 47 DISALLOW_COPY_AND_ASSIGN(KioskAppMenuHandler); |
49 }; | 48 }; |
50 | 49 |
51 } // namespace chromeos | 50 } // namespace chromeos |
52 | 51 |
53 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_APP_MENU_HANDLER_H_ | 52 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_KIOSK_APP_MENU_HANDLER_H_ |
OLD | NEW |