Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/browser/extensions/api/screenlock_private/screenlock_private_api.h

Issue 592893002: Rename ScreelockBridge to SigninScreenBridge Base URL: https://chromium.googlesource.com/chromium/src.git@easy_signin_auth_handler
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/signin_screen_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 extensions { 14 namespace extensions {
15 15
16 class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction { 16 class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction {
17 public: 17 public:
18 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked", 18 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked",
19 SCREENLOCKPRIVATE_GETLOCKED) 19 SCREENLOCKPRIVATE_GETLOCKED)
20 ScreenlockPrivateGetLockedFunction(); 20 ScreenlockPrivateGetLockedFunction();
21 virtual bool RunAsync() OVERRIDE; 21 virtual bool RunAsync() OVERRIDE;
(...skipping 22 matching lines...) Expand all
44 SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT) 44 SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT)
45 ScreenlockPrivateAcceptAuthAttemptFunction(); 45 ScreenlockPrivateAcceptAuthAttemptFunction();
46 virtual bool RunSync() OVERRIDE; 46 virtual bool RunSync() OVERRIDE;
47 47
48 private: 48 private:
49 virtual ~ScreenlockPrivateAcceptAuthAttemptFunction(); 49 virtual ~ScreenlockPrivateAcceptAuthAttemptFunction();
50 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateAcceptAuthAttemptFunction); 50 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateAcceptAuthAttemptFunction);
51 }; 51 };
52 52
53 class ScreenlockPrivateEventRouter : public extensions::BrowserContextKeyedAPI, 53 class ScreenlockPrivateEventRouter : public extensions::BrowserContextKeyedAPI,
54 public ScreenlockBridge::Observer { 54 public SigninScreenBridge::Observer {
55 public: 55 public:
56 explicit ScreenlockPrivateEventRouter(content::BrowserContext* context); 56 explicit ScreenlockPrivateEventRouter(content::BrowserContext* context);
57 virtual ~ScreenlockPrivateEventRouter(); 57 virtual ~ScreenlockPrivateEventRouter();
58 58
59 bool OnAuthAttempted(ScreenlockBridge::LockHandler::AuthType auth_type, 59 bool OnAuthAttempted(SigninScreenBridge::LockHandler::AuthType auth_type,
60 const std::string& value); 60 const std::string& value);
61 61
62 // BrowserContextKeyedAPI 62 // BrowserContextKeyedAPI
63 static extensions::BrowserContextKeyedAPIFactory< 63 static extensions::BrowserContextKeyedAPIFactory<
64 ScreenlockPrivateEventRouter>* 64 ScreenlockPrivateEventRouter>*
65 GetFactoryInstance(); 65 GetFactoryInstance();
66 virtual void Shutdown() OVERRIDE; 66 virtual void Shutdown() OVERRIDE;
67 67
68 // ScreenlockBridge::Observer 68 // SigninScreenBridge::Observer
69 virtual void OnScreenDidLock() OVERRIDE; 69 virtual void OnScreenDidLock() OVERRIDE;
70 virtual void OnScreenDidUnlock() OVERRIDE; 70 virtual void OnScreenDidUnlock() OVERRIDE;
71 virtual void OnFocusedUserChanged(const std::string& user_id) OVERRIDE; 71 virtual void OnFocusedUserChanged(const std::string& user_id) OVERRIDE;
72 72
73 private: 73 private:
74 friend class extensions::BrowserContextKeyedAPIFactory< 74 friend class extensions::BrowserContextKeyedAPIFactory<
75 ScreenlockPrivateEventRouter>; 75 ScreenlockPrivateEventRouter>;
76 76
77 // BrowserContextKeyedAPI 77 // BrowserContextKeyedAPI
78 static const char* service_name() { 78 static const char* service_name() {
79 return "ScreenlockPrivateEventRouter"; 79 return "ScreenlockPrivateEventRouter";
80 } 80 }
81 static const bool kServiceIsNULLWhileTesting = true; 81 static const bool kServiceIsNULLWhileTesting = true;
82 static const bool kServiceRedirectedInIncognito = true; 82 static const bool kServiceRedirectedInIncognito = true;
83 83
84 void DispatchEvent(const std::string& event_name, base::Value* arg); 84 void DispatchEvent(const std::string& event_name, base::Value* arg);
85 85
86 content::BrowserContext* browser_context_; 86 content::BrowserContext* browser_context_;
87 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter); 87 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter);
88 }; 88 };
89 89
90 } // namespace extensions 90 } // namespace extensions
91 91
92 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A PI_H_ 92 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A PI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698