Commit 5310c4cf authored by asargent@chromium.org's avatar asargent@chromium.org

Move app notification getChannel API out of experimental

We're still gating things at the server with trusted testers, but to be able
to do experiments with real apps we need to remove the requirement for the
experimental flag (you can't install apps from the webstore that have the
experimental permission).

BUG=98145
TEST=Should be able to install an app with the 'appNotifications' permission.


Review URL: http://codereview.chromium.org/8776022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112648 0039d316-1c4b-4281-b951-d872f2087c98
parent 1749d14a
......@@ -15,14 +15,7 @@
using content::BrowserThread;
class AppNotificationTest : public ExtensionBrowserTest {
public:
void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
ExtensionBrowserTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(
switches::kEnableExperimentalExtensionApis);
}
};
class AppNotificationTest : public ExtensionBrowserTest {};
namespace {
......
......@@ -177,7 +177,7 @@ void ExtensionTabHelper::OnGetAppNotifyChannel(
bool allowed =
extension &&
extension->HasAPIPermission(
ExtensionAPIPermission::kExperimental) &&
ExtensionAPIPermission::kAppNotifications) &&
process_map->Contains(extension->id(), process->GetID());
if (!allowed) {
Send(new ExtensionMsg_GetAppNotifyChannelResponse(
......
......@@ -211,6 +211,12 @@ void ExtensionAPIPermission::RegisterAllPermissions(
kWebstorePrivate, "webstorePrivate", 0,
ExtensionPermissionMessage::kNone, kFlagComponentOnly, kTypeAll);
// Register hosted / packaged app permissions.
info->RegisterPermission(
kAppNotifications, "appNotifications", 0,
ExtensionPermissionMessage::kNone, kFlagSupportsOptional,
kTypeHostedApp | kTypePackagedApp);
// Register extension permissions.
info->RegisterPermission(
kBookmark, "bookmarks", IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS,
......
......@@ -91,6 +91,7 @@ class ExtensionAPIPermission {
kUnknown = -1,
// Real permissions.
kAppNotifications,
kBackground,
kBookmark,
kChromeAuthPrivate,
......
......@@ -142,6 +142,7 @@ TEST(ExtensionAPIPermissionTest, Aliases) {
TEST(ExtensionAPIPermissionTest, HostedAppPermissions) {
ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance();
ExtensionAPIPermissionSet hosted_perms;
hosted_perms.insert(ExtensionAPIPermission::kAppNotifications);
hosted_perms.insert(ExtensionAPIPermission::kBackground);
hosted_perms.insert(ExtensionAPIPermission::kClipboardRead);
hosted_perms.insert(ExtensionAPIPermission::kClipboardWrite);
......@@ -168,6 +169,7 @@ TEST(ExtensionAPIPermissionTest, HostedAppPermissions) {
TEST(ExtensionAPIPermissionTest, PlatformAppPermissions) {
ExtensionPermissionsInfo* info = ExtensionPermissionsInfo::GetInstance();
ExtensionAPIPermissionSet blacklist;
blacklist.insert(ExtensionAPIPermission::kAppNotifications);
blacklist.insert(ExtensionAPIPermission::kChromeAuthPrivate);
blacklist.insert(ExtensionAPIPermission::kChromePrivate);
blacklist.insert(ExtensionAPIPermission::kCookie);
......@@ -629,6 +631,7 @@ TEST(ExtensionPermissionSetTest, PermissionMessages) {
// These are considered "nuisance" or "trivial" permissions that don't need
// a prompt.
skip.insert(ExtensionAPIPermission::kAppNotifications);
skip.insert(ExtensionAPIPermission::kContextMenus);
skip.insert(ExtensionAPIPermission::kIdle);
skip.insert(ExtensionAPIPermission::kNotification);
......
......@@ -20,15 +20,16 @@ var chrome = chrome || {};
this.install = Install;
this.getDetails = GetDetails;
this.getDetailsForFrame = GetDetailsForFrame;
this.experimental = {
getNotificationChannel: function(clientId, callback) {
var callbackId = 0;
if (callback) {
callbackId = nextCallbackId++;
callbacks[callbackId] = callback;
}
GetAppNotifyChannel(clientId, callbackId);
}();
chrome.appNotifications = new function() {
this.getChannel = function(clientId, callback) {
var callbackId = 0;
if (callback) {
callbackId = nextCallbackId++;
callbacks[callbackId] = callback;
}
GetAppNotifyChannel(clientId, callbackId);
};
}();
......
......@@ -2,4 +2,4 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
chrome.app.experimental.getNotificationChannel({"clientId":"dummy_client_id"});
chrome.appNotifications.getChannel({"clientId":"dummy_client_id"});
{
"name": "Notifications Test App",
"version": "0.5",
"permissions": ["experimental"],
"permissions": ["appNotifications"],
"app": {
"launch": {
"local_path": "launch.html"
......
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