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

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

Issue 13486004: Audio extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to trunk@195702 and fix conflicts. Created 7 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/audio/audio_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/audio/audio_api.h
diff --git a/chrome/browser/extensions/api/audio/audio_api.h b/chrome/browser/extensions/api/audio/audio_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..c8530f6ffb3bccc9b507fff79131d686a5932f31
--- /dev/null
+++ b/chrome/browser/extensions/api/audio/audio_api.h
@@ -0,0 +1,80 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_
+
+#include "chrome/browser/extensions/api/audio/audio_service.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
+#include "chrome/browser/extensions/extension_function.h"
+
+namespace extensions {
+
+class AudioService;
+
+class AudioAPI : public ProfileKeyedAPI,
+ public AudioService::Observer {
+ public:
+ explicit AudioAPI(Profile* profile);
+ virtual ~AudioAPI();
+
+ AudioService* GetService() const;
+
+ // ProfileKeyedAPI implementation.
+ static ProfileKeyedAPIFactory<AudioAPI>* GetFactoryInstance();
+
+ // AudioService::Observer implementation.
+ virtual void OnDeviceChanged() OVERRIDE;
+
+ private:
+ friend class ProfileKeyedAPIFactory<AudioAPI>;
+
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() {
+ return "AudioAPI";
+ }
+
+ Profile* const profile_;
+ AudioService* service_;
+};
+
+class AudioGetInfoFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("audio.getInfo",
+ AUDIO_GETINFO);
+
+ protected:
+ virtual ~AudioGetInfoFunction() {}
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ void OnGetInfoCompleted(const OutputInfo& output_info,
+ const InputInfo& input_info,
+ bool success);
+};
+
+class AudioSetActiveDevicesFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("audio.setActiveDevices",
+ AUDIO_SETACTIVEDEVICES);
+
+ protected:
+ virtual ~AudioSetActiveDevicesFunction() {}
+ virtual bool RunImpl() OVERRIDE;
+};
+
+class AudioSetPropertiesFunction : public AsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("audio.setProperties",
+ AUDIO_SETPROPERTIES);
+
+ protected:
+ virtual ~AudioSetPropertiesFunction() {}
+ virtual bool RunImpl() OVERRIDE;
+};
+
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_AUDIO_AUDIO_API_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/api/audio/audio_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698