OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_COMMON_EXTENSIONS_MANIFEST_HANDLERS_KIOSK_ENABLED_INFO_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_ |
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_KIOSK_ENABLED_INFO_H_ | 6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/common/extensions/extension.h" | 11 #include "chrome/common/extensions/extension.h" |
12 #include "chrome/common/extensions/manifest_handler.h" | 12 #include "chrome/common/extensions/manifest_handler.h" |
13 #include "extensions/common/manifest.h" | 13 #include "extensions/common/manifest.h" |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 struct KioskEnabledInfo : public Extension::ManifestData { | 17 struct KioskEnabledInfo : public Extension::ManifestData { |
18 explicit KioskEnabledInfo(bool is_kiosk_enabled); | 18 explicit KioskEnabledInfo(bool is_kiosk_enabled); |
19 virtual ~KioskEnabledInfo(); | 19 virtual ~KioskEnabledInfo(); |
20 | 20 |
21 bool kiosk_enabled; | 21 bool kiosk_enabled; |
22 | 22 |
23 // Whether the extension or app should be enabled in app kiosk mode. | 23 // Whether the extension or app should be enabled in app kiosk mode. |
24 static bool IsKioskEnabled(const Extension* extension); | 24 static bool IsKioskEnabled(const Extension* extension); |
25 }; | 25 }; |
26 | 26 |
not at google - send to devlin
2013/09/24 18:35:17
consider replacing these with an enum:
// somethi
Tim Song
2013/09/24 18:50:01
I considered this, but an issue arises when callin
not at google - send to devlin
2013/09/24 18:55:17
I think this is fine; I CC'ed Yoyo who is the mani
Tim Song
2013/09/24 19:09:06
Alright, then we'll just have one ManifestData for
| |
27 // Parses the "kiosk_enabled" manifest key. | 27 struct KioskOnlyInfo : public Extension::ManifestData { |
28 class KioskEnabledHandler : public ManifestHandler { | 28 explicit KioskOnlyInfo(bool is_kiosk_only); |
29 virtual ~KioskOnlyInfo(); | |
30 | |
31 bool kiosk_only; | |
32 | |
33 // Whether the extension or app should only be available in kiosk mode. | |
34 static bool IsKioskOnly(const Extension* extension); | |
35 }; | |
36 | |
37 // Parses the "kiosk_enabled" and "kiosk_only" manifest keys. | |
38 class KioskModeHandler : public ManifestHandler { | |
29 public: | 39 public: |
30 KioskEnabledHandler(); | 40 KioskModeHandler(); |
31 virtual ~KioskEnabledHandler(); | 41 virtual ~KioskModeHandler(); |
32 | 42 |
33 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; | 43 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
44 | |
34 private: | 45 private: |
35 virtual const std::vector<std::string> Keys() const OVERRIDE; | 46 virtual const std::vector<std::string> Keys() const OVERRIDE; |
36 | 47 |
37 DISALLOW_COPY_AND_ASSIGN(KioskEnabledHandler); | 48 std::vector<std::string> supported_keys_; |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(KioskModeHandler); | |
38 }; | 51 }; |
39 | 52 |
40 } // namespace extensions | 53 } // namespace extensions |
41 | 54 |
42 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_KIOSK_ENABLED_INFO_H_ | 55 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_ |
OLD | NEW |