diff options
Diffstat (limited to 'extensions/common')
-rw-r--r-- | extensions/common/manifest_handlers/kiosk_mode_info.cc | 19 | ||||
-rw-r--r-- | extensions/common/manifest_handlers/kiosk_mode_info.h | 4 |
2 files changed, 11 insertions, 12 deletions
diff --git a/extensions/common/manifest_handlers/kiosk_mode_info.cc b/extensions/common/manifest_handlers/kiosk_mode_info.cc index 5ab5656..d625bfd 100644 --- a/extensions/common/manifest_handlers/kiosk_mode_info.cc +++ b/extensions/common/manifest_handlers/kiosk_mode_info.cc @@ -13,17 +13,6 @@ #include "extensions/common/api/extensions_manifest_types.h" #include "extensions/common/manifest_constants.h" -namespace { - -// Whether the given |version_string| is a valid ChromeOS platform version. -// The acceptable format is major[.minor[.micro]]. -bool IsValidPlatformVersion(const std::string& version_string) { - const base::Version version(version_string); - return version.IsValid() && version.components().size() <= 3u; -} - -} // namespace - namespace extensions { namespace keys = manifest_keys; @@ -64,6 +53,12 @@ bool KioskModeInfo::HasSecondaryApps(const Extension* extension) { return info && !info->secondary_app_ids.empty(); } +// static +bool KioskModeInfo::IsValidPlatformVersion(const std::string& version_string) { + const base::Version version(version_string); + return version.IsValid() && version.components().size() <= 3u; +} + KioskModeHandler::KioskModeHandler() { supported_keys_.push_back(keys::kKiosk); supported_keys_.push_back(keys::kKioskEnabled); @@ -135,7 +130,7 @@ bool KioskModeHandler::Parse(Extension* extension, base::string16* error) { if (manifest->HasPath(keys::kKioskRequiredPlatformVersion) && (!manifest->GetString(keys::kKioskRequiredPlatformVersion, &required_platform_version) || - !IsValidPlatformVersion(required_platform_version))) { + !KioskModeInfo::IsValidPlatformVersion(required_platform_version))) { *error = base::ASCIIToUTF16( manifest_errors::kInvalidKioskRequiredPlatformVersion); return false; diff --git a/extensions/common/manifest_handlers/kiosk_mode_info.h b/extensions/common/manifest_handlers/kiosk_mode_info.h index 514e78e..bd37f96 100644 --- a/extensions/common/manifest_handlers/kiosk_mode_info.h +++ b/extensions/common/manifest_handlers/kiosk_mode_info.h @@ -41,6 +41,10 @@ struct KioskModeInfo : public Extension::ManifestData { // Returns true if |extension| declares kiosk secondary apps. static bool HasSecondaryApps(const Extension* extension); + // Whether the given |version_string| is a valid ChromeOS platform version. + // The acceptable format is major[.minor[.micro]]. + static bool IsValidPlatformVersion(const std::string& version_string); + KioskStatus kiosk_status; // The IDs of the kiosk secondary apps. |