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 EXTENSIONS_COMMON_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_
6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_
11 #include "extensions/common/extension.h"
12 #include "extensions/common/manifest.h"
13 #include "extensions/common/manifest_handler.h"
15 namespace extensions
{
17 struct KioskModeInfo
: public Extension::ManifestData
{
25 KioskModeInfo(KioskStatus kiosk_status
,
26 const std::vector
<std::string
>& secondary_app_ids
);
27 ~KioskModeInfo() override
;
29 // Gets the KioskModeInfo for |extension|, or NULL if none was
31 static KioskModeInfo
* Get(const Extension
* extension
);
33 // Whether the extension or app is enabled for app kiosk mode.
34 static bool IsKioskEnabled(const Extension
* extension
);
36 // Whether the extension or app should only be available in kiosk mode.
37 static bool IsKioskOnly(const Extension
* extension
);
39 // Returns true if |extension| declares kiosk secondary apps.
40 static bool HasSecondaryApps(const Extension
* extension
);
42 KioskStatus kiosk_status
;
44 // The IDs of the kiosk secondary apps.
45 const std::vector
<std::string
> secondary_app_ids
;
48 // Parses the "kiosk_enabled" and "kiosk_only" manifest keys.
49 class KioskModeHandler
: public ManifestHandler
{
52 ~KioskModeHandler() override
;
54 bool Parse(Extension
* extension
, base::string16
* error
) override
;
57 const std::vector
<std::string
> Keys() const override
;
59 std::vector
<std::string
> supported_keys_
;
61 DISALLOW_COPY_AND_ASSIGN(KioskModeHandler
);
64 } // namespace extensions
66 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_