summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2016-03-16 16:47:40 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-16 23:49:54 +0000
commitdc99ab106086dcb7cd12542ac669c9bd4b8fe198 (patch)
tree99fbdea87f4b7504c6996a9917273a2c25932397
parent3edbd8d05df275432f79649ac740070d329b26ea (diff)
downloadchromium_src-dc99ab106086dcb7cd12542ac669c9bd4b8fe198.zip
chromium_src-dc99ab106086dcb7cd12542ac669c9bd4b8fe198.tar.gz
chromium_src-dc99ab106086dcb7cd12542ac669c9bd4b8fe198.tar.bz2
[Extensions] Remove principalsPrivate API
BUG=595168 Review URL: https://codereview.chromium.org/1806723003 Cr-Commit-Position: refs/heads/master@{#381591}
-rw-r--r--chrome/browser/extensions/api/principals_private/OWNERS1
-rw-r--r--chrome/browser/extensions/api/principals_private/principals_private_api.cc46
-rw-r--r--chrome/browser/extensions/api/principals_private/principals_private_api.h71
-rw-r--r--chrome/chrome_browser_extensions.gypi2
-rw-r--r--chrome/common/extensions/api/_api_features.json4
-rw-r--r--chrome/common/extensions/api/_permission_features.json7
-rw-r--r--chrome/common/extensions/api/principals_private.idl18
-rw-r--r--chrome/common/extensions/api/schemas.gypi1
-rw-r--r--chrome/common/extensions/permissions/chrome_api_permissions.cc2
-rw-r--r--chrome/common/extensions/permissions/permission_set_unittest.cc1
-rw-r--r--extensions/common/permissions/api_permission.h2
11 files changed, 1 insertions, 154 deletions
diff --git a/chrome/browser/extensions/api/principals_private/OWNERS b/chrome/browser/extensions/api/principals_private/OWNERS
deleted file mode 100644
index 28111f6..0000000
--- a/chrome/browser/extensions/api/principals_private/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-guohui@chromium.org
diff --git a/chrome/browser/extensions/api/principals_private/principals_private_api.cc b/chrome/browser/extensions/api/principals_private/principals_private_api.cc
deleted file mode 100644
index 867990d..0000000
--- a/chrome/browser/extensions/api/principals_private/principals_private_api.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/api/principals_private/principals_private_api.h"
-
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/profiles/avatar_menu.h"
-#include "chrome/browser/profiles/profile_window.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "components/signin/core/browser/signin_header_helper.h"
-#include "components/signin/core/browser/signin_metrics.h"
-#include "components/signin/core/common/profile_management_switches.h"
-
-namespace extensions {
-
-bool PrincipalsPrivateExtensionFunction::RunSync() {
- if (!switches::IsEnableAccountConsistency()) {
- SetError(
- "Need to enable account consistency to use principalsPrivate API.");
- return false;
- }
- return RunSyncSafe();
-}
-
-bool PrincipalsPrivateSignOutFunction::RunSyncSafe() {
- Browser* browser = GetCurrentBrowser();
- if (browser) {
- profiles::LockProfile(browser->profile());
- }
- return true;
-}
-
-bool PrincipalsPrivateShowAvatarBubbleFunction::RunSyncSafe() {
- Browser* browser = GetCurrentBrowser();
- if (browser) {
- browser->window()->ShowAvatarBubbleFromAvatarButton(
- BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT,
- signin::ManageAccountsParams(),
- signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN);
- }
- return true;
-}
-
-} // namespace extensions
diff --git a/chrome/browser/extensions/api/principals_private/principals_private_api.h b/chrome/browser/extensions/api/principals_private/principals_private_api.h
deleted file mode 100644
index f818549..0000000
--- a/chrome/browser/extensions/api/principals_private/principals_private_api.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_API_PRINCIPALS_PRIVATE_PRINCIPALS_PRIVATE_API_H_
-#define CHROME_BROWSER_EXTENSIONS_API_PRINCIPALS_PRIVATE_PRINCIPALS_PRIVATE_API_H_
-
-#include "base/macros.h"
-#include "chrome/browser/extensions/chrome_extension_function.h"
-
-// WARNING: chrome.principalsPrivate is a set of experimental APIs for the new
-// profile management flows. Every new API must extend
-// PrincipalsPrivateExtensionFunction which is guarded with a flag check
-// for "new-profile-management".
-
-namespace extensions {
-
-class PrincipalsPrivateExtensionFunction : public ChromeSyncExtensionFunction {
- public:
- PrincipalsPrivateExtensionFunction() {}
-
- protected:
- ~PrincipalsPrivateExtensionFunction() override {}
-
- // ExtensionFunction:
- // Checks for the flag "new-profile-management", if set calls
- // RunSyncSafe which must be overriden by subclasses.
- bool RunSync() final;
-
- private:
- virtual bool RunSyncSafe() = 0;
-};
-
-class PrincipalsPrivateSignOutFunction
- : public PrincipalsPrivateExtensionFunction {
- public:
- DECLARE_EXTENSION_FUNCTION("principalsPrivate.signOut",
- PRINCIPALSPRIVATE_SIGNOUT);
- PrincipalsPrivateSignOutFunction() {}
-
- protected:
- ~PrincipalsPrivateSignOutFunction() override {}
-
- private:
- // PrincipalsPrivateExtensionFunction
- bool RunSyncSafe() override;
-
- DISALLOW_COPY_AND_ASSIGN(PrincipalsPrivateSignOutFunction);
-};
-
-class PrincipalsPrivateShowAvatarBubbleFunction
- : public PrincipalsPrivateExtensionFunction {
- public:
- DECLARE_EXTENSION_FUNCTION("principalsPrivate.showAvatarBubble",
- PRINCIPALSPRIVATE_SHOWAVATARBUBBLE);
- PrincipalsPrivateShowAvatarBubbleFunction() {}
-
- protected:
- ~PrincipalsPrivateShowAvatarBubbleFunction() override {}
-
- private:
- // PrincipalsPrivateExtensionFunction
- bool RunSyncSafe() override;
-
- DISALLOW_COPY_AND_ASSIGN(PrincipalsPrivateShowAvatarBubbleFunction);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_API_PRINCIPALS_PRIVATE_PRINCIPALS_PRIVATE_API_H_
-
diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi
index a4d9dc7..33c7dac 100644
--- a/chrome/chrome_browser_extensions.gypi
+++ b/chrome/chrome_browser_extensions.gypi
@@ -429,8 +429,6 @@
'browser/extensions/api/preference/preference_api_constants.h',
'browser/extensions/api/preference/preference_helpers.cc',
'browser/extensions/api/preference/preference_helpers.h',
- 'browser/extensions/api/principals_private/principals_private_api.cc',
- 'browser/extensions/api/principals_private/principals_private_api.h',
'browser/extensions/api/proxy/proxy_api.cc',
'browser/extensions/api/proxy/proxy_api.h',
'browser/extensions/api/proxy/proxy_api_constants.cc',
diff --git a/chrome/common/extensions/api/_api_features.json b/chrome/common/extensions/api/_api_features.json
index 8ef4707..f603cbf 100644
--- a/chrome/common/extensions/api/_api_features.json
+++ b/chrome/common/extensions/api/_api_features.json
@@ -670,10 +670,6 @@
"dependencies": ["permission:preferencesPrivate"],
"contexts": ["blessed_extension"]
},
- "principalsPrivate": {
- "dependencies": ["permission:principalsPrivate"],
- "contexts": ["blessed_extension"]
- },
"privacy": {
"dependencies": ["permission:privacy"],
"contexts": ["blessed_extension"]
diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/common/extensions/api/_permission_features.json
index 4319714..158bb33 100644
--- a/chrome/common/extensions/api/_permission_features.json
+++ b/chrome/common/extensions/api/_permission_features.json
@@ -807,13 +807,6 @@
"location": "component"
}
],
- "principalsPrivate": {
- "channel": "stable",
- "extension_types": ["extension"],
- "whitelist": [
- "2779FA8B45841D61A37207CCFAC9CB393964FE5B" // Login Proxy (prototype)
- ]
- },
"privacy": {
"channel": "stable",
"extension_types": ["extension", "legacy_packaged_app"]
diff --git a/chrome/common/extensions/api/principals_private.idl b/chrome/common/extensions/api/principals_private.idl
deleted file mode 100644
index bc1925d..0000000
--- a/chrome/common/extensions/api/principals_private.idl
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Experimental APIs to trigger Chrome sign in actions.
-// Only enabled if the flag "new-profile-management" is set.
-namespace principalsPrivate {
-
- interface Functions {
- // Triggers Chrome sign out.
- // Only enabled if the flag "new-profile-management" is set.
- static void signOut();
-
- // Shows the avatar bubble.
- // Only enabled if the flag "new-profile-management" is set.
- static void showAvatarBubble();
- };
-};
diff --git a/chrome/common/extensions/api/schemas.gypi b/chrome/common/extensions/api/schemas.gypi
index 39d6103..8dc9057 100644
--- a/chrome/common/extensions/api/schemas.gypi
+++ b/chrome/common/extensions/api/schemas.gypi
@@ -97,7 +97,6 @@
'extension.json',
'idltest.idl',
'music_manager_private.idl',
- 'principals_private.idl',
'top_sites.json',
],
diff --git a/chrome/common/extensions/permissions/chrome_api_permissions.cc b/chrome/common/extensions/permissions/chrome_api_permissions.cc
index 98ab0988..c494814 100644
--- a/chrome/common/extensions/permissions/chrome_api_permissions.cc
+++ b/chrome/common/extensions/permissions/chrome_api_permissions.cc
@@ -182,8 +182,6 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions()
"webrtcDesktopCapturePrivate", APIPermissionInfo::kFlagCannotBeOptional},
{APIPermission::kWebrtcLoggingPrivate, "webrtcLoggingPrivate",
APIPermissionInfo::kFlagCannotBeOptional},
- {APIPermission::kPrincipalsPrivate, "principalsPrivate",
- APIPermissionInfo::kFlagCannotBeOptional},
{APIPermission::kFirstRunPrivate, "firstRunPrivate",
APIPermissionInfo::kFlagCannotBeOptional},
{APIPermission::kInlineInstallPrivate, "inlineInstallPrivate"},
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index 68e13b1..c85eed3 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -843,7 +843,6 @@ TEST(PermissionsTest, PermissionMessages) {
skip.insert(APIPermission::kMediaRouterPrivate);
skip.insert(APIPermission::kMetricsPrivate);
skip.insert(APIPermission::kPreferencesPrivate);
- skip.insert(APIPermission::kPrincipalsPrivate);
skip.insert(APIPermission::kImageWriterPrivate);
skip.insert(APIPermission::kResourcesPrivate);
skip.insert(APIPermission::kRtcPrivate);
diff --git a/extensions/common/permissions/api_permission.h b/extensions/common/permissions/api_permission.h
index 0b6f1a3..f690362 100644
--- a/extensions/common/permissions/api_permission.h
+++ b/extensions/common/permissions/api_permission.h
@@ -161,7 +161,7 @@ class APIPermission {
kPlugin,
kPower,
kPreferencesPrivate,
- kPrincipalsPrivate,
+ kDeleted_PrincipalsPrivate,
kPrinterProvider,
kPrivacy,
kProcesses,