Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / extensions / common / manifest_handlers / kiosk_mode_info.h
blobcf02b0dbd61f0386708e523676d357a0430bbfe8
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_
8 #include <string>
9 #include <vector>
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 {
18 public:
19 enum KioskStatus {
20 NONE,
21 ENABLED,
22 ONLY
25 explicit KioskModeInfo(KioskStatus kiosk_status);
26 ~KioskModeInfo() override;
28 KioskStatus kiosk_status;
30 // Whether the extension or app is enabled for app kiosk mode.
31 static bool IsKioskEnabled(const Extension* extension);
33 // Whether the extension or app should only be available in kiosk mode.
34 static bool IsKioskOnly(const Extension* extension);
37 // Parses the "kiosk_enabled" and "kiosk_only" manifest keys.
38 class KioskModeHandler : public ManifestHandler {
39 public:
40 KioskModeHandler();
41 ~KioskModeHandler() override;
43 bool Parse(Extension* extension, base::string16* error) override;
45 private:
46 const std::vector<std::string> Keys() const override;
48 std::vector<std::string> supported_keys_;
50 DISALLOW_COPY_AND_ASSIGN(KioskModeHandler);
53 } // namespace extensions
55 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_