| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/signin/easy_unlock_app_manager.h" | 5 #include "chrome/browser/signin/easy_unlock_app_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 if (!event_router->ExtensionHasEventListener(app_id_, event_name)) | 160 if (!event_router->ExtensionHasEventListener(app_id_, event_name)) |
| 161 return false; | 161 return false; |
| 162 | 162 |
| 163 extensions::api::easy_unlock_private::UserInfo info; | 163 extensions::api::easy_unlock_private::UserInfo info; |
| 164 info.user_id = user_id; | 164 info.user_id = user_id; |
| 165 info.logged_in = is_logged_in; | 165 info.logged_in = is_logged_in; |
| 166 info.data_ready = data_ready; | 166 info.data_ready = data_ready; |
| 167 | 167 |
| 168 std::unique_ptr<base::ListValue> args(new base::ListValue()); | 168 std::unique_ptr<base::ListValue> args(new base::ListValue()); |
| 169 args->Append(info.ToValue().release()); | 169 args->Append(info.ToValue()); |
| 170 | 170 |
| 171 std::unique_ptr<extensions::Event> event( | 171 std::unique_ptr<extensions::Event> event( |
| 172 new extensions::Event(histogram_value, event_name, std::move(args))); | 172 new extensions::Event(histogram_value, event_name, std::move(args))); |
| 173 | 173 |
| 174 event_router->DispatchEventToExtension(app_id_, std::move(event)); | 174 event_router->DispatchEventToExtension(app_id_, std::move(event)); |
| 175 return true; | 175 return true; |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool EasyUnlockAppManagerImpl::SendAuthAttemptEvent() { | 178 bool EasyUnlockAppManagerImpl::SendAuthAttemptEvent() { |
| 179 ExtensionService* extension_service = extension_system_->extension_service(); | 179 ExtensionService* extension_service = extension_system_->extension_service(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 // static | 196 // static |
| 197 std::unique_ptr<EasyUnlockAppManager> EasyUnlockAppManager::Create( | 197 std::unique_ptr<EasyUnlockAppManager> EasyUnlockAppManager::Create( |
| 198 extensions::ExtensionSystem* extension_system, | 198 extensions::ExtensionSystem* extension_system, |
| 199 int manifest_id, | 199 int manifest_id, |
| 200 const base::FilePath& app_path) { | 200 const base::FilePath& app_path) { |
| 201 return std::unique_ptr<EasyUnlockAppManager>( | 201 return std::unique_ptr<EasyUnlockAppManager>( |
| 202 new EasyUnlockAppManagerImpl(extension_system, manifest_id, app_path)); | 202 new EasyUnlockAppManagerImpl(extension_system, manifest_id, app_path)); |
| 203 } | 203 } |
| OLD | NEW |