| 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_OPTIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" |
| 10 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" | 11 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" |
| 11 #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler
.h" | 12 #include "content/public/browser/web_ui_message_handler.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class DictionaryValue; | 15 class DictionaryValue; |
| 15 class ListValue; | 16 class ListValue; |
| 16 } | 17 } |
| 17 | 18 |
| 19 namespace content { |
| 20 class WebUIDataSource; |
| 21 } |
| 22 |
| 18 namespace chromeos { | 23 namespace chromeos { |
| 19 | 24 |
| 20 class KioskAppManager; | 25 class KioskAppManager; |
| 21 | 26 |
| 22 namespace options { | 27 class KioskAppsHandler : public content::WebUIMessageHandler, |
| 23 | |
| 24 class KioskAppsHandler : public CoreChromeOSOptionsHandler, | |
| 25 public KioskAppManagerObserver { | 28 public KioskAppManagerObserver { |
| 26 public: | 29 public: |
| 27 KioskAppsHandler(); | 30 KioskAppsHandler(); |
| 28 virtual ~KioskAppsHandler(); | 31 virtual ~KioskAppsHandler(); |
| 29 | 32 |
| 30 // options::OptionsPageUIHandler overrides: | 33 void GetLocalizedValues(content::WebUIDataSource* source); |
| 34 |
| 35 // content::WebUIMessageHandler overrides: |
| 31 virtual void RegisterMessages() OVERRIDE; | 36 virtual void RegisterMessages() OVERRIDE; |
| 32 virtual void GetLocalizedValues( | |
| 33 base::DictionaryValue* localized_strings) OVERRIDE; | |
| 34 | 37 |
| 35 // KioskAppPrefsObserver overrides: | 38 // KioskAppPrefsObserver overrides: |
| 36 virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE; | 39 virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE; |
| 37 virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE; | 40 virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE; |
| 41 virtual void OnKioskAppsSettingsChanged() OVERRIDE; |
| 38 | 42 |
| 39 private: | 43 private: |
| 40 // Sends all kiosk apps to webui. | 44 // Sends all kiosk apps and settings to webui. |
| 41 void SendKioskApps(); | 45 void SendKioskAppSettings(); |
| 42 | 46 |
| 43 // JS callbacks. | 47 // JS callbacks. |
| 44 void HandleGetKioskApps(const base::ListValue* args); | 48 void HandleGetKioskAppSettings(const base::ListValue* args); |
| 45 void HandleAddKioskApp(const base::ListValue* args); | 49 void HandleAddKioskApp(const base::ListValue* args); |
| 46 void HandleRemoveKioskApp(const base::ListValue* args); | 50 void HandleRemoveKioskApp(const base::ListValue* args); |
| 47 void HandleEnableKioskAutoLaunch(const base::ListValue* args); | 51 void HandleEnableKioskAutoLaunch(const base::ListValue* args); |
| 48 void HandleDisableKioskAutoLaunch(const base::ListValue* args); | 52 void HandleDisableKioskAutoLaunch(const base::ListValue* args); |
| 53 void HandleSetDisableBailoutShortcut(const base::ListValue* args); |
| 49 | 54 |
| 50 KioskAppManager* kiosk_app_manager_; // not owned. | 55 KioskAppManager* kiosk_app_manager_; // not owned. |
| 51 bool initialized_; | 56 bool initialized_; |
| 52 | 57 |
| 53 DISALLOW_COPY_AND_ASSIGN(KioskAppsHandler); | 58 DISALLOW_COPY_AND_ASSIGN(KioskAppsHandler); |
| 54 }; | 59 }; |
| 55 | 60 |
| 56 } // namespace options | |
| 57 } // namespace chromeos | 61 } // namespace chromeos |
| 58 | 62 |
| 59 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ | 63 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ |
| OLD | NEW |