| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 13 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 14 #include "extensions/browser/extension_function.h" | 14 #include "extensions/browser/extension_function.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class BrowserContext; | 17 class BrowserContext; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace extensions { | 20 namespace extensions { |
| 21 class MediaPlayerEventRouter; | 21 class MediaPlayerEventRouter; |
| 22 | 22 |
| 23 class MediaPlayerAPI : public ProfileKeyedAPI { | 23 class MediaPlayerAPI : public BrowserContextKeyedAPI { |
| 24 public: | 24 public: |
| 25 explicit MediaPlayerAPI(content::BrowserContext* context); | 25 explicit MediaPlayerAPI(content::BrowserContext* context); |
| 26 virtual ~MediaPlayerAPI(); | 26 virtual ~MediaPlayerAPI(); |
| 27 | 27 |
| 28 // Convenience method to get the MediaPlayerAPI for a profile. | 28 // Convenience method to get the MediaPlayerAPI for a profile. |
| 29 static MediaPlayerAPI* Get(content::BrowserContext* context); | 29 static MediaPlayerAPI* Get(content::BrowserContext* context); |
| 30 | 30 |
| 31 MediaPlayerEventRouter* media_player_event_router(); | 31 MediaPlayerEventRouter* media_player_event_router(); |
| 32 | 32 |
| 33 // ProfileKeyedAPI implementation. | 33 // BrowserContextKeyedAPI implementation. |
| 34 static ProfileKeyedAPIFactory<MediaPlayerAPI>* GetFactoryInstance(); | 34 static BrowserContextKeyedAPIFactory<MediaPlayerAPI>* GetFactoryInstance(); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 friend class ProfileKeyedAPIFactory<MediaPlayerAPI>; | 37 friend class BrowserContextKeyedAPIFactory<MediaPlayerAPI>; |
| 38 | 38 |
| 39 content::BrowserContext* const browser_context_; | 39 content::BrowserContext* const browser_context_; |
| 40 | 40 |
| 41 // ProfileKeyedAPI implementation. | 41 // BrowserContextKeyedAPI implementation. |
| 42 static const char* service_name() { | 42 static const char* service_name() { |
| 43 return "MediaPlayerAPI"; | 43 return "MediaPlayerAPI"; |
| 44 } | 44 } |
| 45 static const bool kServiceRedirectedInIncognito = true; | 45 static const bool kServiceRedirectedInIncognito = true; |
| 46 static const bool kServiceIsNULLWhileTesting = true; | 46 static const bool kServiceIsNULLWhileTesting = true; |
| 47 | 47 |
| 48 scoped_ptr<MediaPlayerEventRouter> media_player_event_router_; | 48 scoped_ptr<MediaPlayerEventRouter> media_player_event_router_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAPI); | 50 DISALLOW_COPY_AND_ASSIGN(MediaPlayerAPI); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace extensions | 53 } // namespace extensions |
| 54 | 54 |
| 55 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ | 55 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_MEDIA_PLAYER_API_H_ |
| OLD | NEW |