Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / webui / extensions / chromeos / kiosk_apps_handler.h
blob9e9987a235d5df200f4fcb87e30e4e83699ff0e8
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_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
13 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h"
14 #include "content/public/browser/web_ui_message_handler.h"
16 namespace base {
17 class DictionaryValue;
18 class ListValue;
21 namespace content {
22 class WebUIDataSource;
25 namespace chromeos {
27 class KioskAppManager;
29 class KioskAppsHandler : public content::WebUIMessageHandler,
30 public KioskAppManagerObserver {
31 public:
32 KioskAppsHandler();
33 virtual ~KioskAppsHandler();
35 void GetLocalizedValues(content::WebUIDataSource* source);
37 // content::WebUIMessageHandler overrides:
38 virtual void RegisterMessages() OVERRIDE;
40 // KioskAppPrefsObserver overrides:
41 virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE;
42 virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE;
43 virtual void OnKioskAppsSettingsChanged() OVERRIDE;
45 private:
46 // Sends all kiosk apps and settings to webui.
47 void SendKioskAppSettings();
49 // JS callbacks.
50 void HandleInitializeKioskAppSettings(const base::ListValue* args);
51 void HandleGetKioskAppSettings(const base::ListValue* args);
52 void HandleAddKioskApp(const base::ListValue* args);
53 void HandleRemoveKioskApp(const base::ListValue* args);
54 void HandleEnableKioskAutoLaunch(const base::ListValue* args);
55 void HandleDisableKioskAutoLaunch(const base::ListValue* args);
56 void HandleSetDisableBailoutShortcut(const base::ListValue* args);
58 // Callback for KioskAppManager::GetConsumerKioskModeStatus().
59 void OnGetConsumerKioskModeStatus(
60 chromeos::KioskAppManager::ConsumerKioskModeStatus status);
62 KioskAppManager* kiosk_app_manager_; // not owned.
63 bool initialized_;
64 bool is_kiosk_enabled_;
65 base::WeakPtrFactory<KioskAppsHandler> weak_ptr_factory_;
67 DISALLOW_COPY_AND_ASSIGN(KioskAppsHandler);
70 } // namespace chromeos
72 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_