Commit 86d20497 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

devtools: Fix Wake Lock permission names.

Introduce the same changes added to the regular Permissions API
implementation in r756753: instead of having a "wake-lock" permission with a
|type| field set to either "screen" or "system", the spec now uses two
separate permissions with no |type| field, "screen-wake-lock" and
"system-wake-lock".

Fixed: 1121076
Change-Id: Ib050a1efa82143c177e32bb6a39cad9203198dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2372365
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800998}
parent 99a31bec
...@@ -186,19 +186,10 @@ Response PermissionDescriptorToPermissionType( ...@@ -186,19 +186,10 @@ Response PermissionDescriptorToPermissionType(
*permission_type = PermissionType::IDLE_DETECTION; *permission_type = PermissionType::IDLE_DETECTION;
} else if (name == "periodic-background-sync") { } else if (name == "periodic-background-sync") {
*permission_type = PermissionType::PERIODIC_BACKGROUND_SYNC; *permission_type = PermissionType::PERIODIC_BACKGROUND_SYNC;
} else if (name == "wake-lock") { } else if (name == "screen-wake-lock") {
if (!descriptor->HasType()) { *permission_type = PermissionType::WAKE_LOCK_SCREEN;
return Response::InvalidParams( } else if (name == "system-wake-lock") {
"Could not parse WakeLockPermissionDescriptor with property type"); *permission_type = PermissionType::WAKE_LOCK_SYSTEM;
}
const std::string type = descriptor->GetType("");
if (type == "screen") {
*permission_type = PermissionType::WAKE_LOCK_SCREEN;
} else if (type == "system") {
*permission_type = PermissionType::WAKE_LOCK_SYSTEM;
} else {
return Response::InvalidParams("Invalid WakeLockType: " + type);
}
} else if (name == "nfc") { } else if (name == "nfc") {
*permission_type = PermissionType::NFC; *permission_type = PermissionType::NFC;
} else if (name == "window-placement") { } else if (name == "window-placement") {
......
...@@ -826,8 +826,6 @@ domain Browser ...@@ -826,8 +826,6 @@ domain Browser
# For "push" permission, may specify userVisibleOnly. # For "push" permission, may specify userVisibleOnly.
# Note that userVisibleOnly = true is the only currently supported type. # Note that userVisibleOnly = true is the only currently supported type.
optional boolean userVisibleOnly optional boolean userVisibleOnly
# For "wake-lock" permission, must specify type as either "screen" or "system".
optional string type
# For "clipboard" permission, may specify allowWithoutSanitization. # For "clipboard" permission, may specify allowWithoutSanitization.
optional boolean allowWithoutSanitization optional boolean allowWithoutSanitization
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment