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 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" | 5 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/ptr_util.h" |
10 #include "base/values.h" | 11 #include "base/values.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/signin/chrome_proximity_auth_client.h" | 13 #include "chrome/browser/signin/chrome_proximity_auth_client.h" |
13 #include "chrome/browser/signin/easy_unlock_service.h" | 14 #include "chrome/browser/signin/easy_unlock_service.h" |
14 #include "chrome/common/extensions/api/screenlock_private.h" | 15 #include "chrome/common/extensions/api/screenlock_private.h" |
15 #include "chrome/common/extensions/extension_constants.h" | 16 #include "chrome/common/extensions/extension_constants.h" |
16 #include "components/proximity_auth/screenlock_bridge.h" | 17 #include "components/proximity_auth/screenlock_bridge.h" |
17 #include "extensions/browser/app_window/app_window_registry.h" | 18 #include "extensions/browser/app_window/app_window_registry.h" |
18 #include "extensions/browser/event_router.h" | 19 #include "extensions/browser/event_router.h" |
19 | 20 |
(...skipping 27 matching lines...) Expand all Loading... |
47 return screenlock::AUTH_TYPE_OFFLINEPASSWORD; | 48 return screenlock::AUTH_TYPE_OFFLINEPASSWORD; |
48 } | 49 } |
49 | 50 |
50 } // namespace | 51 } // namespace |
51 | 52 |
52 ScreenlockPrivateGetLockedFunction::ScreenlockPrivateGetLockedFunction() {} | 53 ScreenlockPrivateGetLockedFunction::ScreenlockPrivateGetLockedFunction() {} |
53 | 54 |
54 ScreenlockPrivateGetLockedFunction::~ScreenlockPrivateGetLockedFunction() {} | 55 ScreenlockPrivateGetLockedFunction::~ScreenlockPrivateGetLockedFunction() {} |
55 | 56 |
56 bool ScreenlockPrivateGetLockedFunction::RunAsync() { | 57 bool ScreenlockPrivateGetLockedFunction::RunAsync() { |
57 SetResult(new base::FundamentalValue( | 58 SetResult(base::MakeUnique<base::FundamentalValue>( |
58 proximity_auth::ScreenlockBridge::Get()->IsLocked())); | 59 proximity_auth::ScreenlockBridge::Get()->IsLocked())); |
59 SendResponse(error_.empty()); | 60 SendResponse(error_.empty()); |
60 return true; | 61 return true; |
61 } | 62 } |
62 | 63 |
63 ScreenlockPrivateSetLockedFunction::ScreenlockPrivateSetLockedFunction() {} | 64 ScreenlockPrivateSetLockedFunction::ScreenlockPrivateSetLockedFunction() {} |
64 | 65 |
65 ScreenlockPrivateSetLockedFunction::~ScreenlockPrivateSetLockedFunction() {} | 66 ScreenlockPrivateSetLockedFunction::~ScreenlockPrivateSetLockedFunction() {} |
66 | 67 |
67 bool ScreenlockPrivateSetLockedFunction::RunAsync() { | 68 bool ScreenlockPrivateSetLockedFunction::RunAsync() { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 args->AppendString(value); | 170 args->AppendString(value); |
170 | 171 |
171 std::unique_ptr<Event> event( | 172 std::unique_ptr<Event> event( |
172 new Event(events::SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED, | 173 new Event(events::SCREENLOCK_PRIVATE_ON_AUTH_ATTEMPTED, |
173 screenlock::OnAuthAttempted::kEventName, std::move(args))); | 174 screenlock::OnAuthAttempted::kEventName, std::move(args))); |
174 router->BroadcastEvent(std::move(event)); | 175 router->BroadcastEvent(std::move(event)); |
175 return true; | 176 return true; |
176 } | 177 } |
177 | 178 |
178 } // namespace extensions | 179 } // namespace extensions |
OLD | NEW |