| 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_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES_PR
IVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES_PR
IVATE_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES_PR
IVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES_PR
IVATE_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/extensions/api/media_galleries_private/gallery_watch_st
ate_tracker.h" | 13 #include "chrome/browser/extensions/api/media_galleries_private/gallery_watch_st
ate_tracker.h" |
| 14 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 14 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
| 15 #include "chrome/browser/extensions/chrome_extension_function.h" | 15 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 16 #include "chrome/browser/media_galleries/media_galleries_preferences.h" | 16 #include "chrome/browser/media_galleries/media_galleries_preferences.h" |
| 17 #include "chrome/common/extensions/api/media_galleries_private.h" | 17 #include "chrome/common/extensions/api/media_galleries_private.h" |
| 18 #include "extensions/browser/event_router.h" | 18 #include "extensions/browser/event_router.h" |
| 19 | 19 |
| 20 class Profile; | 20 class Profile; |
| 21 | 21 |
| 22 namespace content { |
| 23 class BrowserContext; |
| 24 } |
| 25 |
| 22 namespace extensions { | 26 namespace extensions { |
| 23 | 27 |
| 24 class MediaGalleriesPrivateEventRouter; | 28 class MediaGalleriesPrivateEventRouter; |
| 25 | 29 |
| 26 // The profile-keyed service that manages the media galleries private extension | 30 // The profile-keyed service that manages the media galleries private extension |
| 27 // API. Created at the same time as the Profile. | 31 // API. Created at the same time as the Profile. |
| 28 class MediaGalleriesPrivateAPI : public ProfileKeyedAPI, | 32 class MediaGalleriesPrivateAPI : public ProfileKeyedAPI, |
| 29 public EventRouter::Observer { | 33 public EventRouter::Observer { |
| 30 public: | 34 public: |
| 31 explicit MediaGalleriesPrivateAPI(Profile* profile); | 35 explicit MediaGalleriesPrivateAPI(content::BrowserContext* context); |
| 32 virtual ~MediaGalleriesPrivateAPI(); | 36 virtual ~MediaGalleriesPrivateAPI(); |
| 33 | 37 |
| 34 // BrowserContextKeyedService implementation. | 38 // BrowserContextKeyedService implementation. |
| 35 virtual void Shutdown() OVERRIDE; | 39 virtual void Shutdown() OVERRIDE; |
| 36 | 40 |
| 37 // ProfileKeyedAPI implementation. | 41 // ProfileKeyedAPI implementation. |
| 38 static ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>* GetFactoryInstance(); | 42 static ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>* GetFactoryInstance(); |
| 39 | 43 |
| 40 // Convenience method to get the MediaGalleriesPrivateAPI for a profile. | 44 // Convenience method to get the MediaGalleriesPrivateAPI for a profile. |
| 41 static MediaGalleriesPrivateAPI* Get(Profile* profile); | 45 static MediaGalleriesPrivateAPI* Get(content::BrowserContext* context); |
| 42 | 46 |
| 43 // EventRouter::Observer implementation. | 47 // EventRouter::Observer implementation. |
| 44 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 48 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
| 45 | 49 |
| 46 MediaGalleriesPrivateEventRouter* GetEventRouter(); | 50 MediaGalleriesPrivateEventRouter* GetEventRouter(); |
| 47 GalleryWatchStateTracker* GetGalleryWatchStateTracker(); | 51 GalleryWatchStateTracker* GetGalleryWatchStateTracker(); |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 friend class ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>; | 54 friend class ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>; |
| 51 | 55 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 protected: | 155 protected: |
| 152 virtual ~MediaGalleriesPrivateGetHandlersFunction(); | 156 virtual ~MediaGalleriesPrivateGetHandlersFunction(); |
| 153 | 157 |
| 154 // AsyncExtensionFunction overrides. | 158 // AsyncExtensionFunction overrides. |
| 155 virtual bool RunImpl() OVERRIDE; | 159 virtual bool RunImpl() OVERRIDE; |
| 156 }; | 160 }; |
| 157 | 161 |
| 158 } // namespace extensions | 162 } // namespace extensions |
| 159 | 163 |
| 160 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES
_PRIVATE_API_H_ | 164 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES
_PRIVATE_API_H_ |
| OLD | NEW |