OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/api/audio/audio_service.h" | 8 #include "chrome/browser/extensions/api/audio/audio_service.h" |
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
10 #include "chrome/browser/extensions/chrome_extension_function.h" | 10 #include "chrome/browser/extensions/chrome_extension_function.h" |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 | 13 |
14 class AudioService; | 14 class AudioService; |
15 | 15 |
16 class AudioAPI : public ProfileKeyedAPI, | 16 class AudioAPI : public ProfileKeyedAPI, |
17 public AudioService::Observer { | 17 public AudioService::Observer { |
18 public: | 18 public: |
19 explicit AudioAPI(Profile* profile); | 19 explicit AudioAPI(content::BrowserContext* context); |
20 virtual ~AudioAPI(); | 20 virtual ~AudioAPI(); |
21 | 21 |
22 AudioService* GetService() const; | 22 AudioService* GetService() const; |
23 | 23 |
24 // ProfileKeyedAPI implementation. | 24 // ProfileKeyedAPI implementation. |
25 static ProfileKeyedAPIFactory<AudioAPI>* GetFactoryInstance(); | 25 static ProfileKeyedAPIFactory<AudioAPI>* GetFactoryInstance(); |
26 | 26 |
27 // AudioService::Observer implementation. | 27 // AudioService::Observer implementation. |
28 virtual void OnDeviceChanged() OVERRIDE; | 28 virtual void OnDeviceChanged() OVERRIDE; |
29 | 29 |
30 private: | 30 private: |
31 friend class ProfileKeyedAPIFactory<AudioAPI>; | 31 friend class ProfileKeyedAPIFactory<AudioAPI>; |
32 | 32 |
33 // ProfileKeyedAPI implementation. | 33 // ProfileKeyedAPI implementation. |
34 static const char* service_name() { | 34 static const char* service_name() { |
35 return "AudioAPI"; | 35 return "AudioAPI"; |
36 } | 36 } |
37 | 37 |
38 Profile* const profile_; | 38 content::BrowserContext* const browser_context_; |
39 AudioService* service_; | 39 AudioService* service_; |
40 }; | 40 }; |
41 | 41 |
42 class AudioGetInfoFunction : public ChromeAsyncExtensionFunction { | 42 class AudioGetInfoFunction : public ChromeAsyncExtensionFunction { |
43 public: | 43 public: |
44 DECLARE_EXTENSION_FUNCTION("audio.getInfo", | 44 DECLARE_EXTENSION_FUNCTION("audio.getInfo", |
45 AUDIO_GETINFO); | 45 AUDIO_GETINFO); |
46 | 46 |
47 protected: | 47 protected: |
48 virtual ~AudioGetInfoFunction() {} | 48 virtual ~AudioGetInfoFunction() {} |
(...skipping 22 matching lines...) Expand all Loading... |
71 | 71 |
72 protected: | 72 protected: |
73 virtual ~AudioSetPropertiesFunction() {} | 73 virtual ~AudioSetPropertiesFunction() {} |
74 virtual bool RunImpl() OVERRIDE; | 74 virtual bool RunImpl() OVERRIDE; |
75 }; | 75 }; |
76 | 76 |
77 | 77 |
78 } // namespace extensions | 78 } // namespace extensions |
79 | 79 |
80 #endif // CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_ | 80 #endif // CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_ |
OLD | NEW |