summaryrefslogtreecommitdiffstats
path: root/extensions/common/manifest_handlers/kiosk_mode_info.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/common/manifest_handlers/kiosk_mode_info.cc')
-rw-r--r--extensions/common/manifest_handlers/kiosk_mode_info.cc19
1 files changed, 7 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;