OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_API_
H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_API_
H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_API_
H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_API_
H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
11 #include "chrome/browser/signin/screenlock_bridge.h" | 11 #include "chrome/browser/signin/screenlock_bridge.h" |
12 #include "extensions/browser/browser_context_keyed_api_factory.h" | 12 #include "extensions/browser/browser_context_keyed_api_factory.h" |
13 | 13 |
14 namespace gfx { | |
15 class Image; | |
16 } | |
17 | |
18 namespace extensions { | 14 namespace extensions { |
19 | 15 |
20 class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction { | 16 class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction { |
21 public: | 17 public: |
22 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked", | 18 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked", |
23 SCREENLOCKPRIVATE_GETLOCKED) | 19 SCREENLOCKPRIVATE_GETLOCKED) |
24 ScreenlockPrivateGetLockedFunction(); | 20 ScreenlockPrivateGetLockedFunction(); |
25 virtual bool RunAsync() OVERRIDE; | 21 virtual bool RunAsync() OVERRIDE; |
26 | 22 |
27 private: | 23 private: |
28 virtual ~ScreenlockPrivateGetLockedFunction(); | 24 virtual ~ScreenlockPrivateGetLockedFunction(); |
29 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetLockedFunction); | 25 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetLockedFunction); |
30 }; | 26 }; |
31 | 27 |
32 class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction { | 28 class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction { |
33 public: | 29 public: |
34 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setLocked", | 30 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setLocked", |
35 SCREENLOCKPRIVATE_SETLOCKED) | 31 SCREENLOCKPRIVATE_SETLOCKED) |
36 ScreenlockPrivateSetLockedFunction(); | 32 ScreenlockPrivateSetLockedFunction(); |
37 virtual bool RunAsync() OVERRIDE; | 33 virtual bool RunAsync() OVERRIDE; |
38 | 34 |
39 private: | 35 private: |
40 virtual ~ScreenlockPrivateSetLockedFunction(); | 36 virtual ~ScreenlockPrivateSetLockedFunction(); |
41 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction); | 37 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction); |
42 }; | 38 }; |
43 | 39 |
44 class ScreenlockPrivateShowMessageFunction | |
45 : public ChromeAsyncExtensionFunction { | |
46 public: | |
47 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage", | |
48 SCREENLOCKPRIVATE_SHOWMESSAGE) | |
49 ScreenlockPrivateShowMessageFunction(); | |
50 virtual bool RunAsync() OVERRIDE; | |
51 | |
52 private: | |
53 virtual ~ScreenlockPrivateShowMessageFunction(); | |
54 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction); | |
55 }; | |
56 | |
57 class ScreenlockPrivateShowCustomIconFunction | |
58 : public ChromeAsyncExtensionFunction { | |
59 public: | |
60 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showCustomIcon", | |
61 SCREENLOCKPRIVATE_SHOWCUSTOMICON) | |
62 ScreenlockPrivateShowCustomIconFunction(); | |
63 virtual bool RunAsync() OVERRIDE; | |
64 | |
65 private: | |
66 virtual ~ScreenlockPrivateShowCustomIconFunction(); | |
67 void OnImageLoaded(const gfx::Image& image); | |
68 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowCustomIconFunction); | |
69 }; | |
70 | |
71 class ScreenlockPrivateHideCustomIconFunction | |
72 : public ChromeAsyncExtensionFunction { | |
73 public: | |
74 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.hideCustomIcon", | |
75 SCREENLOCKPRIVATE_HIDECUSTOMICON) | |
76 ScreenlockPrivateHideCustomIconFunction(); | |
77 virtual bool RunAsync() OVERRIDE; | |
78 | |
79 private: | |
80 virtual ~ScreenlockPrivateHideCustomIconFunction(); | |
81 void OnImageLoaded(const gfx::Image& image); | |
82 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateHideCustomIconFunction); | |
83 }; | |
84 | |
85 class ScreenlockPrivateSetAuthTypeFunction | |
86 : public ChromeAsyncExtensionFunction { | |
87 public: | |
88 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setAuthType", | |
89 SCREENLOCKPRIVATE_SETAUTHTYPE) | |
90 ScreenlockPrivateSetAuthTypeFunction(); | |
91 virtual bool RunAsync() OVERRIDE; | |
92 | |
93 private: | |
94 virtual ~ScreenlockPrivateSetAuthTypeFunction(); | |
95 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetAuthTypeFunction); | |
96 }; | |
97 | |
98 class ScreenlockPrivateGetAuthTypeFunction | |
99 : public ChromeAsyncExtensionFunction { | |
100 public: | |
101 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getAuthType", | |
102 SCREENLOCKPRIVATE_GETAUTHTYPE) | |
103 ScreenlockPrivateGetAuthTypeFunction(); | |
104 virtual bool RunAsync() OVERRIDE; | |
105 | |
106 private: | |
107 virtual ~ScreenlockPrivateGetAuthTypeFunction(); | |
108 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetAuthTypeFunction); | |
109 }; | |
110 | |
111 class ScreenlockPrivateAcceptAuthAttemptFunction | 40 class ScreenlockPrivateAcceptAuthAttemptFunction |
112 : public ChromeAsyncExtensionFunction { | 41 : public ChromeAsyncExtensionFunction { |
113 public: | 42 public: |
114 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt", | 43 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt", |
115 SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT) | 44 SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT) |
116 ScreenlockPrivateAcceptAuthAttemptFunction(); | 45 ScreenlockPrivateAcceptAuthAttemptFunction(); |
117 virtual bool RunAsync() OVERRIDE; | 46 virtual bool RunAsync() OVERRIDE; |
118 | 47 |
119 private: | 48 private: |
120 virtual ~ScreenlockPrivateAcceptAuthAttemptFunction(); | 49 virtual ~ScreenlockPrivateAcceptAuthAttemptFunction(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 82 |
154 void DispatchEvent(const std::string& event_name, base::Value* arg); | 83 void DispatchEvent(const std::string& event_name, base::Value* arg); |
155 | 84 |
156 content::BrowserContext* browser_context_; | 85 content::BrowserContext* browser_context_; |
157 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter); | 86 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter); |
158 }; | 87 }; |
159 | 88 |
160 } // namespace extensions | 89 } // namespace extensions |
161 | 90 |
162 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A
PI_H_ | 91 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A
PI_H_ |
OLD | NEW |