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 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // EventRouter::Observer implementation. | 68 // EventRouter::Observer implementation. |
69 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; | 69 virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE; |
70 | 70 |
71 MediaGalleriesPrivateEventRouter* GetEventRouter(); | 71 MediaGalleriesPrivateEventRouter* GetEventRouter(); |
72 GalleryWatchStateTracker* GetGalleryWatchStateTracker(); | 72 GalleryWatchStateTracker* GetGalleryWatchStateTracker(); |
73 | 73 |
74 private: | 74 private: |
75 friend class ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>; | 75 friend class ProfileKeyedAPIFactory<MediaGalleriesPrivateAPI>; |
76 | 76 |
77 void MaybeInitializeEventRouter(); | 77 void MaybeInitializeEventRouterAndTracker(); |
78 | 78 |
79 // ProfileKeyedAPI implementation. | 79 // ProfileKeyedAPI implementation. |
80 static const char* service_name() { | 80 static const char* service_name() { |
81 return "MediaGalleriesPrivateAPI"; | 81 return "MediaGalleriesPrivateAPI"; |
82 } | 82 } |
83 static const bool kServiceIsNULLWhileTesting = true; | 83 static const bool kServiceIsNULLWhileTesting = true; |
84 | 84 |
85 // Current profile. | 85 // Current profile. |
86 Profile* profile_; | 86 Profile* profile_; |
87 | 87 |
88 GalleryWatchStateTracker tracker_; | 88 scoped_ptr<GalleryWatchStateTracker> tracker_; |
89 | 89 |
90 // Created lazily on first access. | 90 // Created lazily on first access. |
91 scoped_ptr<MediaGalleriesPrivateEventRouter> | 91 scoped_ptr<MediaGalleriesPrivateEventRouter> |
92 media_galleries_private_event_router_; | 92 media_galleries_private_event_router_; |
93 | 93 |
94 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPrivateAPI); | 94 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPrivateAPI); |
95 }; | 95 }; |
96 | 96 |
97 // Implements the chrome.mediaGalleriesPrivate.addGalleryWatch method. | 97 // Implements the chrome.mediaGalleriesPrivate.addGalleryWatch method. |
98 class MediaGalleriesPrivateAddGalleryWatchFunction | 98 class MediaGalleriesPrivateAddGalleryWatchFunction |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 protected: | 181 protected: |
182 virtual ~MediaGalleriesPrivateGetHandlersFunction(); | 182 virtual ~MediaGalleriesPrivateGetHandlersFunction(); |
183 | 183 |
184 // AsyncExtensionFunction overrides. | 184 // AsyncExtensionFunction overrides. |
185 virtual bool RunImpl() OVERRIDE; | 185 virtual bool RunImpl() OVERRIDE; |
186 }; | 186 }; |
187 | 187 |
188 } // namespace extensions | 188 } // namespace extensions |
189 | 189 |
190 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES
_PRIVATE_API_H_ | 190 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES
_PRIVATE_API_H_ |
OLD | NEW |