| 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 "extensions/browser/api/hid/hid_api.h" | 5 #include "extensions/browser/api/hid/hid_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "device/core/device_client.h" | 10 #include "device/core/device_client.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (input->usage) { | 52 if (input->usage) { |
| 53 output->SetUsage(*input->usage); | 53 output->SetUsage(*input->usage); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 namespace extensions { | 59 namespace extensions { |
| 60 | 60 |
| 61 HidAsyncApiFunction::HidAsyncApiFunction() | 61 HidAsyncApiFunction::HidAsyncApiFunction() |
| 62 : device_manager_(NULL), connection_manager_(NULL) {} | 62 : device_manager_(nullptr), connection_manager_(nullptr) { |
| 63 } |
| 63 | 64 |
| 64 HidAsyncApiFunction::~HidAsyncApiFunction() {} | 65 HidAsyncApiFunction::~HidAsyncApiFunction() {} |
| 65 | 66 |
| 66 bool HidAsyncApiFunction::PrePrepare() { | 67 bool HidAsyncApiFunction::PrePrepare() { |
| 67 device_manager_ = HidDeviceManager::Get(browser_context()); | 68 device_manager_ = HidDeviceManager::Get(browser_context()); |
| 68 DCHECK(device_manager_); | 69 DCHECK(device_manager_); |
| 69 connection_manager_ = | 70 connection_manager_ = |
| 70 ApiResourceManager<HidConnectionResource>::Get(browser_context()); | 71 ApiResourceManager<HidConnectionResource>::Get(browser_context()); |
| 71 DCHECK(connection_manager_); | 72 DCHECK(connection_manager_); |
| 72 set_work_thread_id(content::BrowserThread::FILE); | 73 set_work_thread_id(content::BrowserThread::FILE); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 328 |
| 328 void HidSendFeatureReportFunction::OnFinished(bool success) { | 329 void HidSendFeatureReportFunction::OnFinished(bool success) { |
| 329 if (!success) { | 330 if (!success) { |
| 330 CompleteWithError(kErrorTransfer); | 331 CompleteWithError(kErrorTransfer); |
| 331 return; | 332 return; |
| 332 } | 333 } |
| 333 AsyncWorkCompleted(); | 334 AsyncWorkCompleted(); |
| 334 } | 335 } |
| 335 | 336 |
| 336 } // namespace extensions | 337 } // namespace extensions |
| OLD | NEW |