| 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/webcam_private/webcam_private_api.h" | 5 #include "extensions/browser/api/webcam_private/webcam_private_api.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 #include "content/public/browser/media_device_id.h" | 10 #include "content/public/browser/media_device_id.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 } else { | 198 } else { |
| 199 SetError(kPathInUse); | 199 SetError(kPathInUse); |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 } | 202 } |
| 203 | 203 |
| 204 void WebcamPrivateOpenSerialWebcamFunction::OnOpenWebcam( | 204 void WebcamPrivateOpenSerialWebcamFunction::OnOpenWebcam( |
| 205 const std::string& webcam_id, | 205 const std::string& webcam_id, |
| 206 bool success) { | 206 bool success) { |
| 207 if (success) { | 207 if (success) { |
| 208 SetResult(base::MakeUnique<base::StringValue>(webcam_id)); | 208 SetResult(base::MakeUnique<base::Value>(webcam_id)); |
| 209 SendResponse(true); | 209 SendResponse(true); |
| 210 } else { | 210 } else { |
| 211 SetError(kOpenSerialWebcamError); | 211 SetError(kOpenSerialWebcamError); |
| 212 SendResponse(false); | 212 SendResponse(false); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 | 215 |
| 216 WebcamPrivateCloseWebcamFunction::WebcamPrivateCloseWebcamFunction() { | 216 WebcamPrivateCloseWebcamFunction::WebcamPrivateCloseWebcamFunction() { |
| 217 } | 217 } |
| 218 | 218 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } | 432 } |
| 433 | 433 |
| 434 template <> | 434 template <> |
| 435 void BrowserContextKeyedAPIFactory<WebcamPrivateAPI> | 435 void BrowserContextKeyedAPIFactory<WebcamPrivateAPI> |
| 436 ::DeclareFactoryDependencies() { | 436 ::DeclareFactoryDependencies() { |
| 437 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 437 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 438 DependsOn(ProcessManagerFactory::GetInstance()); | 438 DependsOn(ProcessManagerFactory::GetInstance()); |
| 439 } | 439 } |
| 440 | 440 |
| 441 } // namespace extensions | 441 } // namespace extensions |
| OLD | NEW |