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> |
| 9 |
8 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
9 #include "chrome/browser/signin/screenlock_bridge.h" | 11 #include "chrome/browser/signin/screenlock_bridge.h" |
10 #include "extensions/browser/browser_context_keyed_api_factory.h" | 12 #include "extensions/browser/browser_context_keyed_api_factory.h" |
11 | 13 |
12 namespace gfx { | 14 namespace gfx { |
13 class Image; | 15 class Image; |
14 } | 16 } |
15 | 17 |
16 namespace extensions { | 18 namespace extensions { |
17 | 19 |
(...skipping 24 matching lines...) Expand all Loading... |
42 class ScreenlockPrivateShowMessageFunction | 44 class ScreenlockPrivateShowMessageFunction |
43 : public ChromeAsyncExtensionFunction { | 45 : public ChromeAsyncExtensionFunction { |
44 public: | 46 public: |
45 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage", | 47 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage", |
46 SCREENLOCKPRIVATE_SHOWMESSAGE) | 48 SCREENLOCKPRIVATE_SHOWMESSAGE) |
47 ScreenlockPrivateShowMessageFunction(); | 49 ScreenlockPrivateShowMessageFunction(); |
48 virtual bool RunAsync() OVERRIDE; | 50 virtual bool RunAsync() OVERRIDE; |
49 | 51 |
50 private: | 52 private: |
51 virtual ~ScreenlockPrivateShowMessageFunction(); | 53 virtual ~ScreenlockPrivateShowMessageFunction(); |
52 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction ); | 54 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction); |
53 }; | 55 }; |
54 | 56 |
55 class ScreenlockPrivateShowButtonFunction | 57 class ScreenlockPrivateShowButtonFunction |
56 : public ChromeAsyncExtensionFunction { | 58 : public ChromeAsyncExtensionFunction { |
57 public: | 59 public: |
58 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showButton", | 60 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showButton", |
59 SCREENLOCKPRIVATE_SHOWBUTTON) | 61 SCREENLOCKPRIVATE_SHOWBUTTON) |
60 ScreenlockPrivateShowButtonFunction(); | 62 ScreenlockPrivateShowButtonFunction(); |
61 virtual bool RunAsync() OVERRIDE; | 63 virtual bool RunAsync() OVERRIDE; |
62 | 64 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 virtual ~ScreenlockPrivateAcceptAuthAttemptFunction(); | 120 virtual ~ScreenlockPrivateAcceptAuthAttemptFunction(); |
119 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateAcceptAuthAttemptFunction); | 121 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateAcceptAuthAttemptFunction); |
120 }; | 122 }; |
121 | 123 |
122 class ScreenlockPrivateEventRouter : public extensions::BrowserContextKeyedAPI, | 124 class ScreenlockPrivateEventRouter : public extensions::BrowserContextKeyedAPI, |
123 public ScreenlockBridge::Observer { | 125 public ScreenlockBridge::Observer { |
124 public: | 126 public: |
125 explicit ScreenlockPrivateEventRouter(content::BrowserContext* context); | 127 explicit ScreenlockPrivateEventRouter(content::BrowserContext* context); |
126 virtual ~ScreenlockPrivateEventRouter(); | 128 virtual ~ScreenlockPrivateEventRouter(); |
127 | 129 |
128 void OnButtonClicked(); | |
129 | |
130 void OnAuthAttempted(ScreenlockBridge::LockHandler::AuthType auth_type, | 130 void OnAuthAttempted(ScreenlockBridge::LockHandler::AuthType auth_type, |
131 const std::string& value); | 131 const std::string& value); |
132 | 132 |
133 // BrowserContextKeyedAPI | 133 // BrowserContextKeyedAPI |
134 static extensions::BrowserContextKeyedAPIFactory< | 134 static extensions::BrowserContextKeyedAPIFactory< |
135 ScreenlockPrivateEventRouter>* | 135 ScreenlockPrivateEventRouter>* |
136 GetFactoryInstance(); | 136 GetFactoryInstance(); |
137 virtual void Shutdown() OVERRIDE; | 137 virtual void Shutdown() OVERRIDE; |
138 | 138 |
139 // ScreenlockBridge::Observer | 139 // ScreenlockBridge::Observer |
(...skipping 13 matching lines...) Expand all Loading... |
153 | 153 |
154 void DispatchEvent(const std::string& event_name, base::Value* arg); | 154 void DispatchEvent(const std::string& event_name, base::Value* arg); |
155 | 155 |
156 content::BrowserContext* browser_context_; | 156 content::BrowserContext* browser_context_; |
157 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter); | 157 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter); |
158 }; | 158 }; |
159 | 159 |
160 } // namespace extensions | 160 } // namespace extensions |
161 | 161 |
162 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A
PI_H_ | 162 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A
PI_H_ |
OLD | NEW |