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

Unified Diff: chrome/browser/chromeos/extensions/media_player_api.h

Issue 11638024: Make MediaPlayerEventRouter a PKS to decouple it from ExtensionService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years 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/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 66%
rename from chrome/browser/chromeos/media/media_player_extension_api.h
rename to chrome/browser/chromeos/extensions/media_player_api.h
index 54b60a2f76b86600deb9b68f1c2679232575d703..55276a97e53a11a9de958689cb85c2c7252c8382 100644
--- a/chrome/browser/chromeos/media/media_player_extension_api.h
+++ b/chrome/browser/chromeos/extensions/media_player_api.h
@@ -2,14 +2,21 @@
// 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/extension_function.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
+
+class Profile;
+
+namespace extensions {
+class MediaPlayerEventRouter;
// Implements the chrome.mediaPlayerPrivate.play method.
class PlayMediaplayerFunction : public SyncExtensionFunction {
@@ -59,4 +66,24 @@ class CloseWindowMediaplayerFunction : public SyncExtensionFunction {
virtual bool RunImpl() OVERRIDE;
};
-#endif // CHROME_BROWSER_CHROMEOS_MEDIA_MEDIA_PLAYER_EXTENSION_API_H_
+class MediaPlayerAPI : public ProfileKeyedService {
+ 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();
+
+ private:
+ Profile* const profile_;
+
+ scoped_ptr<MediaPlayerEventRouter> media_player_event_router_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaPlayerAPI);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/media_player_api.cc » ('j') | chrome/browser/chromeos/media/media_player.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698