OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab_capture/tab_capture_registry.h" | 5 #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.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/macros.h" | 10 #include "base/macros.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 TabCaptureRegistry::~TabCaptureRegistry() { | 252 TabCaptureRegistry::~TabCaptureRegistry() { |
253 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this); | 253 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this); |
254 } | 254 } |
255 | 255 |
256 // static | 256 // static |
257 TabCaptureRegistry* TabCaptureRegistry::Get(content::BrowserContext* context) { | 257 TabCaptureRegistry* TabCaptureRegistry::Get(content::BrowserContext* context) { |
258 return BrowserContextKeyedAPIFactory<TabCaptureRegistry>::Get(context); | 258 return BrowserContextKeyedAPIFactory<TabCaptureRegistry>::Get(context); |
259 } | 259 } |
260 | 260 |
261 static base::LazyInstance<BrowserContextKeyedAPIFactory<TabCaptureRegistry> > | 261 static base::LazyInstance<BrowserContextKeyedAPIFactory<TabCaptureRegistry>>:: |
262 g_factory = LAZY_INSTANCE_INITIALIZER; | 262 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
263 | 263 |
264 // static | 264 // static |
265 BrowserContextKeyedAPIFactory<TabCaptureRegistry>* | 265 BrowserContextKeyedAPIFactory<TabCaptureRegistry>* |
266 TabCaptureRegistry::GetFactoryInstance() { | 266 TabCaptureRegistry::GetFactoryInstance() { |
267 return g_factory.Pointer(); | 267 return g_factory.Pointer(); |
268 } | 268 } |
269 | 269 |
270 void TabCaptureRegistry::GetCapturedTabs( | 270 void TabCaptureRegistry::GetCapturedTabs( |
271 const std::string& extension_id, | 271 const std::string& extension_id, |
272 base::ListValue* list_of_capture_info) const { | 272 base::ListValue* list_of_capture_info) const { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 it != requests_.end(); ++it) { | 464 it != requests_.end(); ++it) { |
465 if (it->get() == request) { | 465 if (it->get() == request) { |
466 requests_.erase(it); | 466 requests_.erase(it); |
467 return; | 467 return; |
468 } | 468 } |
469 } | 469 } |
470 NOTREACHED(); | 470 NOTREACHED(); |
471 } | 471 } |
472 | 472 |
473 } // namespace extensions | 473 } // namespace extensions |
OLD | NEW |