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

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

Issue 585213002: [Easy signin] Wire up userClick auth attempt to easy unlock app and back (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@easy_signin_focused_user_changed_observer
Patch Set: . Created 6 years, 2 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"
(...skipping 20 matching lines...) Expand all
31 SCREENLOCKPRIVATE_SETLOCKED) 31 SCREENLOCKPRIVATE_SETLOCKED)
32 ScreenlockPrivateSetLockedFunction(); 32 ScreenlockPrivateSetLockedFunction();
33 virtual bool RunAsync() OVERRIDE; 33 virtual bool RunAsync() OVERRIDE;
34 34
35 private: 35 private:
36 virtual ~ScreenlockPrivateSetLockedFunction(); 36 virtual ~ScreenlockPrivateSetLockedFunction();
37 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction); 37 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction);
38 }; 38 };
39 39
40 class ScreenlockPrivateAcceptAuthAttemptFunction 40 class ScreenlockPrivateAcceptAuthAttemptFunction
41 : public ChromeAsyncExtensionFunction { 41 : public ChromeSyncExtensionFunction {
42 public: 42 public:
43 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt", 43 DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt",
44 SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT) 44 SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT)
45 ScreenlockPrivateAcceptAuthAttemptFunction(); 45 ScreenlockPrivateAcceptAuthAttemptFunction();
46 virtual bool RunAsync() 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 ScreenlockBridge::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 void OnAuthAttempted(ScreenlockBridge::LockHandler::AuthType auth_type, 59 bool OnAuthAttempted(ScreenlockBridge::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 // ScreenlockBridge::Observer
69 virtual void OnScreenDidLock() OVERRIDE; 69 virtual void OnScreenDidLock() OVERRIDE;
(...skipping 13 matching lines...) Expand all
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