1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PRINCIPALS_PRIVATE_PRINCIPALS_PRIVATE_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_PRINCIPALS_PRIVATE_PRINCIPALS_PRIVATE_API_H_
8 #include "chrome/browser/extensions/chrome_extension_function.h"
10 // WARNING: chrome.principalsPrivate is a set of experimental APIs for the new
11 // profile management flows. Every new API must extend
12 // PrincipalsPrivateExtensionFunction which is guarded with a flag check
13 // for "new-profile-management".
15 namespace extensions
{
17 class PrincipalsPrivateExtensionFunction
: public ChromeSyncExtensionFunction
{
19 PrincipalsPrivateExtensionFunction() {}
22 ~PrincipalsPrivateExtensionFunction() override
{}
25 // Checks for the flag "new-profile-management", if set calls
26 // RunSyncSafe which must be overriden by subclasses.
30 virtual bool RunSyncSafe() = 0;
33 class PrincipalsPrivateSignOutFunction
34 : public PrincipalsPrivateExtensionFunction
{
36 DECLARE_EXTENSION_FUNCTION("principalsPrivate.signOut",
37 PRINCIPALSPRIVATE_SIGNOUT
);
38 PrincipalsPrivateSignOutFunction() {}
41 ~PrincipalsPrivateSignOutFunction() override
{}
44 // PrincipalsPrivateExtensionFunction
45 bool RunSyncSafe() override
;
47 DISALLOW_COPY_AND_ASSIGN(PrincipalsPrivateSignOutFunction
);
50 class PrincipalsPrivateShowAvatarBubbleFunction
51 : public PrincipalsPrivateExtensionFunction
{
53 DECLARE_EXTENSION_FUNCTION("principalsPrivate.showAvatarBubble",
54 PRINCIPALSPRIVATE_SHOWAVATARBUBBLE
);
55 PrincipalsPrivateShowAvatarBubbleFunction() {}
58 ~PrincipalsPrivateShowAvatarBubbleFunction() override
{}
61 // PrincipalsPrivateExtensionFunction
62 bool RunSyncSafe() override
;
64 DISALLOW_COPY_AND_ASSIGN(PrincipalsPrivateShowAvatarBubbleFunction
);
67 } // namespace extensions
69 #endif // CHROME_BROWSER_EXTENSIONS_API_PRINCIPALS_PRIVATE_PRINCIPALS_PRIVATE_API_H_