OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" | 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64url.h" | 10 #include "base/base64url.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #endif | 61 #endif |
62 | 62 |
63 using proximity_auth::ScreenlockState; | 63 using proximity_auth::ScreenlockState; |
64 | 64 |
65 namespace extensions { | 65 namespace extensions { |
66 | 66 |
67 namespace easy_unlock_private = api::easy_unlock_private; | 67 namespace easy_unlock_private = api::easy_unlock_private; |
68 | 68 |
69 namespace { | 69 namespace { |
70 | 70 |
71 static base::LazyInstance<BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI> > | 71 static base::LazyInstance<BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>>:: |
72 g_factory = LAZY_INSTANCE_INITIALIZER; | 72 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
73 | 73 |
74 // Utility method for getting the API's crypto delegate. | 74 // Utility method for getting the API's crypto delegate. |
75 EasyUnlockPrivateCryptoDelegate* GetCryptoDelegate( | 75 EasyUnlockPrivateCryptoDelegate* GetCryptoDelegate( |
76 content::BrowserContext* context) { | 76 content::BrowserContext* context) { |
77 return BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>::Get(context) | 77 return BrowserContextKeyedAPIFactory<EasyUnlockPrivateAPI>::Get(context) |
78 ->GetCryptoDelegate(); | 78 ->GetCryptoDelegate(); |
79 } | 79 } |
80 | 80 |
81 EasyUnlockPrivateConnectionManager* GetConnectionManager( | 81 EasyUnlockPrivateConnectionManager* GetConnectionManager( |
82 content::BrowserContext* context) { | 82 content::BrowserContext* context) { |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 GetConnectionManager(browser_context()) | 1181 GetConnectionManager(browser_context()) |
1182 ->GetDeviceAddress(extension(), params->connection_id); | 1182 ->GetDeviceAddress(extension(), params->connection_id); |
1183 if (device_address.empty()) | 1183 if (device_address.empty()) |
1184 return RespondNow(Error("Invalid connectionId.")); | 1184 return RespondNow(Error("Invalid connectionId.")); |
1185 return RespondNow(ArgumentList( | 1185 return RespondNow(ArgumentList( |
1186 easy_unlock_private::SetupConnectionGetDeviceAddress::Results::Create( | 1186 easy_unlock_private::SetupConnectionGetDeviceAddress::Results::Create( |
1187 device_address))); | 1187 device_address))); |
1188 } | 1188 } |
1189 | 1189 |
1190 } // namespace extensions | 1190 } // namespace extensions |
OLD | NEW |