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_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_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 "base/compiler_specific.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 12 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
13 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" | 13 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" |
14 #include "content/public/browser/web_ui_message_handler.h" | 14 #include "content/public/browser/web_ui_message_handler.h" |
15 | 15 |
16 class Profile; | |
17 | |
16 namespace base { | 18 namespace base { |
17 class DictionaryValue; | 19 class DictionaryValue; |
18 class ListValue; | 20 class ListValue; |
19 } | 21 } |
20 | 22 |
21 namespace content { | 23 namespace content { |
22 class WebUIDataSource; | 24 class WebUIDataSource; |
23 } | 25 } |
24 | 26 |
25 namespace chromeos { | 27 namespace chromeos { |
26 | 28 |
27 class KioskAppManager; | 29 class KioskAppManager; |
30 class OwnerSettingsServiceChromeOS; | |
28 | 31 |
29 class KioskAppsHandler : public content::WebUIMessageHandler, | 32 class KioskAppsHandler : public content::WebUIMessageHandler, |
30 public KioskAppManagerObserver { | 33 public KioskAppManagerObserver { |
31 public: | 34 public: |
32 KioskAppsHandler(); | 35 explicit KioskAppsHandler(Profile* profile); |
Mattias Nissler (ping if slow)
2015/04/07 12:59:18
Might as well just pass OwnerSettingsService* here
| |
33 ~KioskAppsHandler() override; | 36 ~KioskAppsHandler() override; |
34 | 37 |
35 void GetLocalizedValues(content::WebUIDataSource* source); | 38 void GetLocalizedValues(content::WebUIDataSource* source); |
36 | 39 |
37 // content::WebUIMessageHandler overrides: | 40 // content::WebUIMessageHandler overrides: |
38 void RegisterMessages() override; | 41 void RegisterMessages() override; |
39 | 42 |
40 // KioskAppManagerObserver overrides: | 43 // KioskAppManagerObserver overrides: |
41 void OnKioskAppDataChanged(const std::string& app_id) override; | 44 void OnKioskAppDataChanged(const std::string& app_id) override; |
42 void OnKioskAppDataLoadFailure(const std::string& app_id) override; | 45 void OnKioskAppDataLoadFailure(const std::string& app_id) override; |
(...skipping 19 matching lines...) Expand all Loading... | |
62 void ShowError(const std::string& app_id); | 65 void ShowError(const std::string& app_id); |
63 | 66 |
64 // Callback for KioskAppManager::GetConsumerKioskModeStatus(). | 67 // Callback for KioskAppManager::GetConsumerKioskModeStatus(). |
65 void OnGetConsumerKioskAutoLaunchStatus( | 68 void OnGetConsumerKioskAutoLaunchStatus( |
66 chromeos::KioskAppManager::ConsumerKioskAutoLaunchStatus status); | 69 chromeos::KioskAppManager::ConsumerKioskAutoLaunchStatus status); |
67 | 70 |
68 KioskAppManager* kiosk_app_manager_; // not owned. | 71 KioskAppManager* kiosk_app_manager_; // not owned. |
69 bool initialized_; | 72 bool initialized_; |
70 bool is_kiosk_enabled_; | 73 bool is_kiosk_enabled_; |
71 bool is_auto_launch_enabled_; | 74 bool is_auto_launch_enabled_; |
75 OwnerSettingsServiceChromeOS* owner_settings_service_; | |
72 base::WeakPtrFactory<KioskAppsHandler> weak_ptr_factory_; | 76 base::WeakPtrFactory<KioskAppsHandler> weak_ptr_factory_; |
73 | 77 |
74 DISALLOW_COPY_AND_ASSIGN(KioskAppsHandler); | 78 DISALLOW_COPY_AND_ASSIGN(KioskAppsHandler); |
75 }; | 79 }; |
76 | 80 |
77 } // namespace chromeos | 81 } // namespace chromeos |
78 | 82 |
79 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ | 83 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_CHROMEOS_KIOSK_APPS_HANDLER_H_ |
OLD | NEW |