Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc

Issue 178193030: Rename ProfileKeyedAPI to BrowserContextKeyedAPI and GetProfile to Get. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" 10 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 chrome::NOTIFICATION_FULLSCREEN_CHANGED, 115 chrome::NOTIFICATION_FULLSCREEN_CHANGED,
116 content::NotificationService::AllSources()); 116 content::NotificationService::AllSources());
117 } 117 }
118 118
119 TabCaptureRegistry::~TabCaptureRegistry() { 119 TabCaptureRegistry::~TabCaptureRegistry() {
120 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this); 120 MediaCaptureDevicesDispatcher::GetInstance()->RemoveObserver(this);
121 } 121 }
122 122
123 // static 123 // static
124 TabCaptureRegistry* TabCaptureRegistry::Get(content::BrowserContext* context) { 124 TabCaptureRegistry* TabCaptureRegistry::Get(content::BrowserContext* context) {
125 return ProfileKeyedAPIFactory<TabCaptureRegistry>::GetForProfile(context); 125 return BrowserContextKeyedAPIFactory<TabCaptureRegistry>::Get(context);
126 } 126 }
127 127
128 static base::LazyInstance<ProfileKeyedAPIFactory<TabCaptureRegistry> > 128 static base::LazyInstance<BrowserContextKeyedAPIFactory<TabCaptureRegistry> >
129 g_factory = LAZY_INSTANCE_INITIALIZER; 129 g_factory = LAZY_INSTANCE_INITIALIZER;
130 130
131 // static 131 // static
132 ProfileKeyedAPIFactory<TabCaptureRegistry>* 132 BrowserContextKeyedAPIFactory<TabCaptureRegistry>*
133 TabCaptureRegistry::GetFactoryInstance() { 133 TabCaptureRegistry::GetFactoryInstance() {
134 return g_factory.Pointer(); 134 return g_factory.Pointer();
135 } 135 }
136 136
137 const TabCaptureRegistry::RegistryCaptureInfo 137 const TabCaptureRegistry::RegistryCaptureInfo
138 TabCaptureRegistry::GetCapturedTabs(const std::string& extension_id) const { 138 TabCaptureRegistry::GetCapturedTabs(const std::string& extension_id) const {
139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
140 RegistryCaptureInfo list; 140 RegistryCaptureInfo list;
141 for (ScopedVector<TabCaptureRequest>::const_iterator it = requests_.begin(); 141 for (ScopedVector<TabCaptureRequest>::const_iterator it = requests_.begin();
142 it != requests_.end(); ++it) { 142 it != requests_.end(); ++it) {
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 it != requests_.end(); ++it) { 353 it != requests_.end(); ++it) {
354 if ((*it)->render_process_id == render_process_id && 354 if ((*it)->render_process_id == render_process_id &&
355 (*it)->render_view_id == render_view_id) { 355 (*it)->render_view_id == render_view_id) {
356 requests_.erase(it); 356 requests_.erase(it);
357 return; 357 return;
358 } 358 }
359 } 359 }
360 } 360 }
361 361
362 } // namespace extensions 362 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698