Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / extensions / api / principals_private / principals_private_api.h
blob5f5d96e0c1745a596f25db6c3e5ec0f949a4b6c8
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 {
18 public:
19 PrincipalsPrivateExtensionFunction() {}
21 protected:
22 ~PrincipalsPrivateExtensionFunction() override {}
24 // ExtensionFunction:
25 // Checks for the flag "new-profile-management", if set calls
26 // RunSyncSafe which must be overriden by subclasses.
27 bool RunSync() final;
29 private:
30 virtual bool RunSyncSafe() = 0;
33 class PrincipalsPrivateSignOutFunction
34 : public PrincipalsPrivateExtensionFunction {
35 public:
36 DECLARE_EXTENSION_FUNCTION("principalsPrivate.signOut",
37 PRINCIPALSPRIVATE_SIGNOUT);
38 PrincipalsPrivateSignOutFunction() {}
40 protected:
41 ~PrincipalsPrivateSignOutFunction() override {}
43 private:
44 // PrincipalsPrivateExtensionFunction
45 bool RunSyncSafe() override;
47 DISALLOW_COPY_AND_ASSIGN(PrincipalsPrivateSignOutFunction);
50 class PrincipalsPrivateShowAvatarBubbleFunction
51 : public PrincipalsPrivateExtensionFunction {
52 public:
53 DECLARE_EXTENSION_FUNCTION("principalsPrivate.showAvatarBubble",
54 PRINCIPALSPRIVATE_SHOWAVATARBUBBLE);
55 PrincipalsPrivateShowAvatarBubbleFunction() {}
57 protected:
58 ~PrincipalsPrivateShowAvatarBubbleFunction() override {}
60 private:
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_