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. 4 5 #ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_ 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_ 7 8 #include <string> 9 #include <vector> 10 11 #include "extensions/common/extension.h" 12 #include "extensions/common/manifest.h" 13 #include "extensions/common/manifest_handler.h" 14 15 namespace extensions { 16 17 struct KioskModeInfo : public Extension::ManifestData { 18 public: 19 enum KioskStatus { 20 NONE, 21 ENABLED, 22 ONLY 23 }; 24 25 explicit KioskModeInfo(KioskStatus kiosk_status); 26 virtual ~KioskModeInfo(); 27 28 KioskStatus kiosk_status; 29 30 // Whether the extension or app is enabled for app kiosk mode. 31 static bool IsKioskEnabled(const Extension* extension); 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 { 39 public: 40 KioskModeHandler(); 41 virtual ~KioskModeHandler(); 42 43 virtual bool Parse(Extension* extension, base::string16* error) OVERRIDE; 44 45 private: 46 virtual const std::vector<std::string> Keys() const OVERRIDE; 47 48 std::vector<std::string> supported_keys_; 49 50 DISALLOW_COPY_AND_ASSIGN(KioskModeHandler); 51 }; 52 53 } // namespace extensions 54 55 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_KIOSK_MODE_INFO_H_ 56