diff options
Diffstat (limited to 'chrome/common')
6 files changed, 43 insertions, 21 deletions
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json index b3c6edd..6515a26 100644 --- a/chrome/common/extensions/api/_api_features.json +++ b/chrome/common/extensions/api/_api_features.json @@ -53,6 +53,10 @@ "channel": "stable", "contexts": ["blessed_extension", "unblessed_extension", "content_script"] }, + "app.currentWindowInternal.setShape": { + "dependencies": ["permission:app.window.shape"], + "contexts": ["blessed_extension"] + }, "app.getDetails": { "contexts": ["blessed_extension", "unblessed_extension", "content_script"], "matches": [] diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/common/extensions/api/_permission_features.json index 41aae0d..3ae1b51 100644 --- a/chrome/common/extensions/api/_permission_features.json +++ b/chrome/common/extensions/api/_permission_features.json @@ -40,10 +40,22 @@ "extension_types": ["extension", "legacy_packaged_app", "platform_app"], "min_manifest_version": 2 }, - "alwaysOnTopWindows": { + "app.window.alwaysOnTop": { "channel": "stable", "extension_types": ["platform_app"] }, + "app.window.fullscreen": { + "channel": "stable", + "extension_types": ["platform_app"] + }, + "app.window.fullscreen.overrideEsc": { + "channel": "stable", + "extension_types": ["platform_app"] + }, + "app.window.shape": { + "channel": "dev", + "extension_types": ["platform_app"] + }, "audio": [ { "channel": "dev", @@ -406,10 +418,6 @@ "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"] }, - "fullscreen": { - "channel": "stable", - "extension_types": ["platform_app"] - }, "gcm": { "channel": "dev", "extension_types": ["extension", "platform_app"] @@ -648,10 +656,6 @@ "extension", "legacy_packaged_app", "hosted_app", "platform_app" ] }, - "overrideEscFullscreen": { - "channel": "stable", - "extension_types": ["platform_app"] - }, "echoPrivate": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app", "platform_app"], diff --git a/chrome/common/extensions/api/app_window.idl b/chrome/common/extensions/api/app_window.idl index 2c4dc58..ec1123a 100644 --- a/chrome/common/extensions/api/app_window.idl +++ b/chrome/common/extensions/api/app_window.idl @@ -231,7 +231,7 @@ namespace app.window { // If true, the window will stay above most other windows. If there are // multiple windows of this kind, the currently focused window will be in - // the foreground. Requires the <code>"alwaysOnTopWindows"</code> + // the foreground. Requires the <code>"app.window.alwaysOnTop"</code> // permission. Defaults to false.<br> // Call <code>setAlwaysOnTop()</code> on the window to change this property // after creation.<br> @@ -258,8 +258,9 @@ namespace app.window { // Fullscreens the window.<br> // The user will be able to restore the window by pressing ESC. An // application can prevent the fullscreen state to be left when ESC is - // pressed by requesting the <b>overrideEscFullscreen</b> permission and - // canceling the event by calling .preventDefault(), like this:<br> + // pressed by requesting the <b>app.window.fullscreen.overrideEsc</b> + // permission and canceling the event by calling .preventDefault(), like + // this:<br> // <code>window.onKeyDown = function(e) { if (e.keyCode == 27 /* ESC */) { // e.preventDefault(); } };</code> static void fullscreen(); @@ -331,7 +332,7 @@ namespace app.window { [nodoc] long frameColor; // Set whether the window should stay above most other windows. Requires the - // <code>"alwaysOnTopWindows"</code> permission. + // <code>"app.window.alwaysOnTop"</code> permission. static void setAlwaysOnTop(boolean alwaysOnTop); // The JavaScript 'window' object for the created child. diff --git a/chrome/common/extensions/docs/templates/articles/permission_warnings.html b/chrome/common/extensions/docs/templates/articles/permission_warnings.html index 2001e843..927cce7 100644 --- a/chrome/common/extensions/docs/templates/articles/permission_warnings.html +++ b/chrome/common/extensions/docs/templates/articles/permission_warnings.html @@ -414,7 +414,10 @@ The following permissions don't result in a warning: <ul> <li>"activeTab"</li> {{?is_apps}} - <li>"alwaysOnTopWindows"</li> + <li>"app.window.alwaysOnTop"</li> + <li>"app.window.fullscreen"</li> + <li>"app.window.fullscreen.overrideEsc"</li> + <li>"app.window.shape"</li> {{/is_apps}} <li>"browsingData"</li> <li>"chrome://favicon/"</li> @@ -422,9 +425,6 @@ The following permissions don't result in a warning: <li>"contextMenus"</li> <li>"cookies"</li> <li>"experimental"</li> -{{?is_apps}} - <li>"fullscreen"</li> -{{/is_apps}} <li>"idle"</li> <li>"notifications"</li> {{?is_apps}} diff --git a/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chrome/common/extensions/permissions/chrome_api_permissions.cc index 5799bd1..f05dc67 100644 --- a/chrome/common/extensions/permissions/chrome_api_permissions.cc +++ b/chrome/common/extensions/permissions/chrome_api_permissions.cc @@ -17,6 +17,9 @@ namespace extensions { namespace { +const char kOldAlwaysOnTopWindowsPermission[] = "alwaysOnTopWindows"; +const char kOldFullscreenPermission[] = "fullscreen"; +const char kOldOverrideEscFullscreenPermission[] = "overrideEscFullscreen"; const char kOldUnlimitedStoragePermission[] = "unlimited_storage"; const char kWindowsPermission[] = "windows"; @@ -290,7 +293,7 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions() {APIPermission::kSocket, "socket", APIPermissionInfo::kFlagCannotBeOptional, 0, PermissionMessage::kNone, &CreateAPIPermission<SocketPermission>}, - {APIPermission::kAlwaysOnTopWindows, "alwaysOnTopWindows"}, + {APIPermission::kAlwaysOnTopWindows, "app.window.alwaysOnTop"}, {APIPermission::kAudioCapture, "audioCapture", APIPermissionInfo::kFlagNone, IDS_EXTENSION_PROMPT_WARNING_AUDIO_CAPTURE, @@ -349,10 +352,12 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions() {APIPermission::kSystemDisplay, "system.display"}, {APIPermission::kSystemStorage, "system.storage"}, {APIPermission::kPointerLock, "pointerLock"}, - {APIPermission::kFullscreen, "fullscreen"}, + {APIPermission::kFullscreen, "app.window.fullscreen"}, {APIPermission::kAudio, "audio"}, {APIPermission::kCastStreaming, "cast.streaming"}, - {APIPermission::kOverrideEscFullscreen, "overrideEscFullscreen"}, + {APIPermission::kOverrideEscFullscreen, + "app.window.fullscreen.overrideEsc"}, + {APIPermission::kWindowShape, "app.window.shape"}, // Settings override permissions. {APIPermission::kHomepage, "homepage", @@ -389,6 +394,13 @@ ChromeAPIPermissions::GetAllAliases() const { // Register aliases. std::vector<PermissionsProvider::AliasInfo> aliases; aliases.push_back(PermissionsProvider::AliasInfo( + "app.window.alwaysOnTop", kOldAlwaysOnTopWindowsPermission)); + aliases.push_back(PermissionsProvider::AliasInfo("app.window.fullscreen", + kOldFullscreenPermission)); + aliases.push_back( + PermissionsProvider::AliasInfo("app.window.fullscreen.overrideEsc", + kOldOverrideEscFullscreenPermission)); + aliases.push_back(PermissionsProvider::AliasInfo( "unlimitedStorage", kOldUnlimitedStoragePermission)); aliases.push_back(PermissionsProvider::AliasInfo( "tabs", kWindowsPermission)); diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc index 03481b7..b42fb5e 100644 --- a/chrome/common/extensions/permissions/permission_set_unittest.cc +++ b/chrome/common/extensions/permissions/permission_set_unittest.cc @@ -653,6 +653,7 @@ TEST(PermissionsTest, PermissionMessages) { skip.insert(APIPermission::kIdltest); skip.insert(APIPermission::kLogPrivate); skip.insert(APIPermission::kNotification); + skip.insert(APIPermission::kOverrideEscFullscreen); skip.insert(APIPermission::kPointerLock); skip.insert(APIPermission::kPower); skip.insert(APIPermission::kPushMessaging); @@ -666,7 +667,7 @@ TEST(PermissionsTest, PermissionMessages) { skip.insert(APIPermission::kTts); skip.insert(APIPermission::kUnlimitedStorage); skip.insert(APIPermission::kWebView); - skip.insert(APIPermission::kOverrideEscFullscreen); + skip.insert(APIPermission::kWindowShape); // TODO(erikkay) add a string for this permission. skip.insert(APIPermission::kBackground); |