OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 content::BrowserContext* browser_context; | 90 content::BrowserContext* browser_context; |
91 const std::string extension_id; | 91 const std::string extension_id; |
92 MediaGalleryPrefId gallery_id; | 92 MediaGalleryPrefId gallery_id; |
93 | 93 |
94 // Needed to support storage in STL set, as well as usage as map key. | 94 // Needed to support storage in STL set, as well as usage as map key. |
95 bool operator<(const WatchOwner& other) const; | 95 bool operator<(const WatchOwner& other) const; |
96 }; | 96 }; |
97 | 97 |
98 struct NotificationInfo { | 98 struct NotificationInfo { |
99 NotificationInfo(); | 99 NotificationInfo(); |
| 100 NotificationInfo(const NotificationInfo& other); |
100 ~NotificationInfo(); | 101 ~NotificationInfo(); |
101 | 102 |
102 std::set<WatchOwner> owners; | 103 std::set<WatchOwner> owners; |
103 base::Time last_notify_time; | 104 base::Time last_notify_time; |
104 bool delayed_notification_pending; | 105 bool delayed_notification_pending; |
105 }; | 106 }; |
106 | 107 |
107 typedef std::map<WatchOwner, base::FilePath> WatchesMap; | 108 typedef std::map<WatchOwner, base::FilePath> WatchesMap; |
108 typedef std::map<base::FilePath, NotificationInfo> WatchedPaths; | 109 typedef std::map<base::FilePath, NotificationInfo> WatchedPaths; |
109 typedef std::map<content::BrowserContext*, GalleryWatchManagerObserver*> | 110 typedef std::map<content::BrowserContext*, GalleryWatchManagerObserver*> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // Removes watches when a browser context is shut down as watches contain raw | 164 // Removes watches when a browser context is shut down as watches contain raw |
164 // pointers. | 165 // pointers. |
165 BrowserContextSubscriptionMap browser_context_subscription_map_; | 166 BrowserContextSubscriptionMap browser_context_subscription_map_; |
166 | 167 |
167 base::WeakPtrFactory<GalleryWatchManager> weak_factory_; | 168 base::WeakPtrFactory<GalleryWatchManager> weak_factory_; |
168 | 169 |
169 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager); | 170 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager); |
170 }; | 171 }; |
171 | 172 |
172 #endif // CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ | 173 #endif // CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ |
OLD | NEW |