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" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 bool OnAuthAttempted( | 61 bool OnAuthAttempted( |
62 proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type, | 62 proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type, |
63 const std::string& value); | 63 const std::string& value); |
64 | 64 |
65 // BrowserContextKeyedAPI | 65 // BrowserContextKeyedAPI |
66 static BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>* | 66 static BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>* |
67 GetFactoryInstance(); | 67 GetFactoryInstance(); |
68 void Shutdown() override; | 68 void Shutdown() override; |
69 | 69 |
| 70 private: |
| 71 friend class BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>; |
| 72 |
70 // proximity_auth::ScreenlockBridge::Observer | 73 // proximity_auth::ScreenlockBridge::Observer |
71 void OnScreenDidLock(proximity_auth::ScreenlockBridge::LockHandler::ScreenType | 74 void OnScreenDidLock(proximity_auth::ScreenlockBridge::LockHandler::ScreenType |
72 screen_type) override; | 75 screen_type) override; |
73 void OnScreenDidUnlock( | 76 void OnScreenDidUnlock( |
74 proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) | 77 proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) |
75 override; | 78 override; |
76 void OnFocusedUserChanged(const std::string& user_id) override; | 79 void OnFocusedUserChanged(const AccountId& account_id) override; |
77 | |
78 private: | |
79 friend class BrowserContextKeyedAPIFactory<ScreenlockPrivateEventRouter>; | |
80 | 80 |
81 // BrowserContextKeyedAPI | 81 // BrowserContextKeyedAPI |
82 static const char* service_name() { | 82 static const char* service_name() { |
83 return "ScreenlockPrivateEventRouter"; | 83 return "ScreenlockPrivateEventRouter"; |
84 } | 84 } |
85 static const bool kServiceIsNULLWhileTesting = true; | 85 static const bool kServiceIsNULLWhileTesting = true; |
86 static const bool kServiceRedirectedInIncognito = true; | 86 static const bool kServiceRedirectedInIncognito = true; |
87 | 87 |
88 void DispatchEvent(events::HistogramValue histogram_value, | 88 void DispatchEvent(events::HistogramValue histogram_value, |
89 const std::string& event_name, | 89 const std::string& event_name, |
90 base::Value* arg); | 90 base::Value* arg); |
91 | 91 |
92 content::BrowserContext* browser_context_; | 92 content::BrowserContext* browser_context_; |
93 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter); | 93 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateEventRouter); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace extensions | 96 } // namespace extensions |
97 | 97 |
98 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A
PI_H_ | 98 #endif // CHROME_BROWSER_EXTENSIONS_API_SCREENLOCK_PRIVATE_SCREENLOCK_PRIVATE_A
PI_H_ |
OLD | NEW |