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

Unified Diff: chrome/browser/extensions/api/audio/audio_api.cc

Issue 171813010: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 1). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context_ Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/audio/audio_api.cc
diff --git a/chrome/browser/extensions/api/audio/audio_api.cc b/chrome/browser/extensions/api/audio/audio_api.cc
index bae1eff6f8d81fb0275d36a548af995031e2549e..fecb996578d97b56c16cfa468565413515fd73ef 100644
--- a/chrome/browser/extensions/api/audio/audio_api.cc
+++ b/chrome/browser/extensions/api/audio/audio_api.cc
@@ -22,9 +22,8 @@ ProfileKeyedAPIFactory<AudioAPI>* AudioAPI::GetFactoryInstance() {
return g_factory.Pointer();
}
-AudioAPI::AudioAPI(Profile* profile)
- : profile_(profile),
- service_(AudioService::CreateInstance()) {
+AudioAPI::AudioAPI(content::BrowserContext* context)
+ : browser_context_(context), service_(AudioService::CreateInstance()) {
service_->AddObserver(this);
}
@@ -39,11 +38,12 @@ AudioService* AudioAPI::GetService() const {
}
void AudioAPI::OnDeviceChanged() {
- if (profile_ && ExtensionSystem::Get(profile_)->event_router()) {
+ if (browser_context_ &&
+ ExtensionSystem::Get(browser_context_)->event_router()) {
scoped_ptr<Event> event(new Event(
audio::OnDeviceChanged::kEventName,
scoped_ptr<base::ListValue>(new base::ListValue())));
- ExtensionSystem::Get(profile_)->event_router()->BroadcastEvent(
+ ExtensionSystem::Get(browser_context_)->event_router()->BroadcastEvent(
event.Pass());
}
}
« no previous file with comments | « chrome/browser/extensions/api/audio/audio_api.h ('k') | chrome/browser/extensions/api/bookmarks/bookmarks_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698