Index: chrome/browser/chromeos/extensions/media_player_api.h |
diff --git a/chrome/browser/chromeos/media/media_player_extension_api.h b/chrome/browser/chromeos/extensions/media_player_api.h |
similarity index 58% |
rename from chrome/browser/chromeos/media/media_player_extension_api.h |
rename to chrome/browser/chromeos/extensions/media_player_api.h |
index 54b60a2f76b86600deb9b68f1c2679232575d703..17b012cc57b3f224712eeb9dc205695e3d8961d2 100644 |
--- a/chrome/browser/chromeos/media/media_player_extension_api.h |
+++ b/chrome/browser/chromeos/extensions/media_player_api.h |
@@ -2,15 +2,22 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_EXTENSION_API_H_ |
-#define CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_EXTENSION_API_H_ |
+#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ |
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ |
#include <map> |
#include <string> |
#include <vector> |
+#include "base/memory/scoped_ptr.h" |
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
#include "chrome/browser/extensions/extension_function.h" |
+class Profile; |
+ |
+namespace extensions { |
+class MediaPlayerEventRouter; |
+ |
// Implements the chrome.mediaPlayerPrivate.play method. |
class PlayMediaplayerFunction : public SyncExtensionFunction { |
public: |
@@ -59,4 +66,35 @@ class CloseWindowMediaplayerFunction : public SyncExtensionFunction { |
virtual bool RunImpl() OVERRIDE; |
}; |
-#endif // CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_EXTENSION_API_H_ |
+class MediaPlayerAPI : public ProfileKeyedAPI { |
+ public: |
+ explicit MediaPlayerAPI(Profile* profile); |
+ virtual ~MediaPlayerAPI(); |
+ |
+ // Convenience method to get the MediaPlayerAPI for a profile. |
+ static MediaPlayerAPI* Get(Profile* profile); |
+ |
+ MediaPlayerEventRouter* media_player_event_router(); |
+ |
+ // ProfileKeyedAPI implementation. |
+ static ProfileKeyedAPIFactory<MediaPlayerAPI>* GetFactoryInstance(); |
+ |
+ private: |
+ friend class ProfileKeyedAPIFactory<MediaPlayerAPI>; |
+ |
+ Profile* const profile_; |
+ |
+ // ProfileKeyedAPI implementation. |
+ static const char* service_name() { |
+ return "MediaPlayerAPI"; |
+ } |
+ static const bool kServiceIsNULLWhileTesting = true; |
+ |
+ scoped_ptr<MediaPlayerEventRouter> media_player_event_router_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MediaPlayerAPI); |
+}; |
+ |
+} // namespace extensions |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ |