| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 base::Bind(&WebcamPrivateResetFunction::OnResetWebcam, this)); | 415 base::Bind(&WebcamPrivateResetFunction::OnResetWebcam, this)); |
| 416 | 416 |
| 417 return true; | 417 return true; |
| 418 } | 418 } |
| 419 | 419 |
| 420 void WebcamPrivateResetFunction::OnResetWebcam(bool success) { | 420 void WebcamPrivateResetFunction::OnResetWebcam(bool success) { |
| 421 if (!success) | 421 if (!success) |
| 422 SetError(kResetWebcamError); | 422 SetError(kResetWebcamError); |
| 423 } | 423 } |
| 424 | 424 |
| 425 static base::LazyInstance<BrowserContextKeyedAPIFactory<WebcamPrivateAPI>> | 425 static base::LazyInstance<BrowserContextKeyedAPIFactory<WebcamPrivateAPI>>:: |
| 426 g_factory = LAZY_INSTANCE_INITIALIZER; | 426 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
| 427 | 427 |
| 428 // static | 428 // static |
| 429 BrowserContextKeyedAPIFactory<WebcamPrivateAPI>* | 429 BrowserContextKeyedAPIFactory<WebcamPrivateAPI>* |
| 430 WebcamPrivateAPI::GetFactoryInstance() { | 430 WebcamPrivateAPI::GetFactoryInstance() { |
| 431 return g_factory.Pointer(); | 431 return g_factory.Pointer(); |
| 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 |