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

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: patch rebased Created 7 years, 11 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/chromeos/extensions/media_player_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/media_player_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698