| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 std::set<WatchOwner> owners; | 103 std::set<WatchOwner> owners; |
| 104 base::Time last_notify_time; | 104 base::Time last_notify_time; |
| 105 bool delayed_notification_pending; | 105 bool delayed_notification_pending; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 typedef std::map<WatchOwner, base::FilePath> WatchesMap; | 108 typedef std::map<WatchOwner, base::FilePath> WatchesMap; |
| 109 typedef std::map<base::FilePath, NotificationInfo> WatchedPaths; | 109 typedef std::map<base::FilePath, NotificationInfo> WatchedPaths; |
| 110 typedef std::map<content::BrowserContext*, GalleryWatchManagerObserver*> | 110 typedef std::map<content::BrowserContext*, GalleryWatchManagerObserver*> |
| 111 ObserverMap; | 111 ObserverMap; |
| 112 typedef ScopedPtrMap<content::BrowserContext*, | 112 typedef base::ScopedPtrMap< |
| 113 scoped_ptr<KeyedServiceShutdownNotifier::Subscription>> | 113 content::BrowserContext*, |
| 114 scoped_ptr<KeyedServiceShutdownNotifier::Subscription>> |
| 114 BrowserContextSubscriptionMap; | 115 BrowserContextSubscriptionMap; |
| 115 | 116 |
| 116 // Ensure there is a subscription to shutdown notifications for | 117 // Ensure there is a subscription to shutdown notifications for |
| 117 // |browser_context|. | 118 // |browser_context|. |
| 118 void EnsureBrowserContextSubscription( | 119 void EnsureBrowserContextSubscription( |
| 119 content::BrowserContext* browser_context); | 120 content::BrowserContext* browser_context); |
| 120 | 121 |
| 121 // Stop the FilePathWatcher for |path|. Updates |watched_paths_| but not | 122 // Stop the FilePathWatcher for |path|. Updates |watched_paths_| but not |
| 122 // |registered_watches_|. | 123 // |registered_watches_|. |
| 123 void DeactivateFileWatch(const WatchOwner& owner, const base::FilePath& path); | 124 void DeactivateFileWatch(const WatchOwner& owner, const base::FilePath& path); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // Removes watches when a browser context is shut down as watches contain raw | 165 // Removes watches when a browser context is shut down as watches contain raw |
| 165 // pointers. | 166 // pointers. |
| 166 BrowserContextSubscriptionMap browser_context_subscription_map_; | 167 BrowserContextSubscriptionMap browser_context_subscription_map_; |
| 167 | 168 |
| 168 base::WeakPtrFactory<GalleryWatchManager> weak_factory_; | 169 base::WeakPtrFactory<GalleryWatchManager> weak_factory_; |
| 169 | 170 |
| 170 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager); | 171 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager); |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 #endif // CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ | 174 #endif // CHROME_BROWSER_MEDIA_GALLERIES_GALLERY_WATCH_MANAGER_H_ |
| OLD | NEW |