Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(644)

Side by Side Diff: chrome/browser/extensions/api/media_galleries_private/gallery_watch_manager.h

Issue 23727009: Cleanup: Remove chrome namespace for storage monitor and media galleries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nit Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Manages all the gallery file watchers for the associated profile. This class 5 // Manages all the gallery file watchers for the associated profile. This class
6 // lives on the file thread. This class is instantiated per profile. This 6 // lives on the file thread. This class is instantiated per profile. This
7 // is temporary and will be moved to a permanent, public place in the near 7 // is temporary and will be moved to a permanent, public place in the near
8 // future. Please refer to crbug.com/166950 for more details. 8 // future. Please refer to crbug.com/166950 for more details.
9 9
10 #ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_GALLERY_WATCH_MANA GER_H_ 10 #ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_GALLERY_WATCH_MANA GER_H_
(...skipping 23 matching lines...) Expand all
34 // Notifies about the profile shutdown event. 34 // Notifies about the profile shutdown event.
35 static void OnProfileShutdown(void* profile_id); 35 static void OnProfileShutdown(void* profile_id);
36 36
37 // Sets up a gallery watch for the extension specified by the |extension_id|. 37 // Sets up a gallery watch for the extension specified by the |extension_id|.
38 // |profile_id| specifies the extension profile identifier. 38 // |profile_id| specifies the extension profile identifier.
39 // |gallery_id| specifies the gallery identifier. 39 // |gallery_id| specifies the gallery identifier.
40 // |watch_path| specifies the absolute gallery path. 40 // |watch_path| specifies the absolute gallery path.
41 // Returns true, if the watch setup operation was successful. 41 // Returns true, if the watch setup operation was successful.
42 static bool SetupGalleryWatch( 42 static bool SetupGalleryWatch(
43 void* profile_id, 43 void* profile_id,
44 chrome::MediaGalleryPrefId gallery_id, 44 MediaGalleryPrefId gallery_id,
45 const base::FilePath& watch_path, 45 const base::FilePath& watch_path,
46 const std::string& extension_id, 46 const std::string& extension_id,
47 base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router); 47 base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router);
48 48
49 // Cancels the gallery watch for the extension specified by the 49 // Cancels the gallery watch for the extension specified by the
50 // |extension_id|. |profile_id| specifies the extension profile identifier. 50 // |extension_id|. |profile_id| specifies the extension profile identifier.
51 // |watch_path| specifies the absolute gallery path. 51 // |watch_path| specifies the absolute gallery path.
52 static void RemoveGalleryWatch(void* profile_id, 52 static void RemoveGalleryWatch(void* profile_id,
53 const base::FilePath& watch_path, 53 const base::FilePath& watch_path,
54 const std::string& extension_id); 54 const std::string& extension_id);
55 55
56 // Notifies about the extension unloaded/uninstalled event. 56 // Notifies about the extension unloaded/uninstalled event.
57 static void OnExtensionUnloaded(void* profile_id, 57 static void OnExtensionUnloaded(void* profile_id,
58 const std::string& extension_id); 58 const std::string& extension_id);
59 59
60 private: 60 private:
61 class GalleryFilePathWatcher; 61 class GalleryFilePathWatcher;
62 typedef std::map<base::FilePath, GalleryFilePathWatcher*> WatcherMap; 62 typedef std::map<base::FilePath, GalleryFilePathWatcher*> WatcherMap;
63 63
64 // Use GetForProfile(). 64 // Use GetForProfile().
65 GalleryWatchManager(); 65 GalleryWatchManager();
66 ~GalleryWatchManager(); 66 ~GalleryWatchManager();
67 67
68 // Initiates a gallery watch operation for the extension specified by 68 // Initiates a gallery watch operation for the extension specified by
69 // the |extension_id|. |gallery_id| specifies the gallery identifier and 69 // the |extension_id|. |gallery_id| specifies the gallery identifier and
70 // |watch_path| specifies the absolute path of the gallery. Returns true, 70 // |watch_path| specifies the absolute path of the gallery. Returns true,
71 // if the watch was set successfully. 71 // if the watch was set successfully.
72 bool StartGalleryWatch( 72 bool StartGalleryWatch(
73 chrome::MediaGalleryPrefId gallery_id, 73 MediaGalleryPrefId gallery_id,
74 const base::FilePath& watch_path, 74 const base::FilePath& watch_path,
75 const std::string& extension_id, 75 const std::string& extension_id,
76 base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router); 76 base::WeakPtr<MediaGalleriesPrivateEventRouter> event_router);
77 77
78 // Cancels the gallery watch operation for the extension specified by the 78 // Cancels the gallery watch operation for the extension specified by the
79 // |extension_id|. |watch_path| specifies the absolute path of the gallery. 79 // |extension_id|. |watch_path| specifies the absolute path of the gallery.
80 void StopGalleryWatch(const base::FilePath& watch_path, 80 void StopGalleryWatch(const base::FilePath& watch_path,
81 const std::string& extension_id); 81 const std::string& extension_id);
82 82
83 // Handles the extension unloaded/uninstalled event. 83 // Handles the extension unloaded/uninstalled event.
(...skipping 10 matching lines...) Expand all
94 // Key: Gallery watch path. 94 // Key: Gallery watch path.
95 // Value: GalleryFilePathWatcher*. 95 // Value: GalleryFilePathWatcher*.
96 WatcherMap gallery_watchers_; 96 WatcherMap gallery_watchers_;
97 97
98 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager); 98 DISALLOW_COPY_AND_ASSIGN(GalleryWatchManager);
99 }; 99 };
100 100
101 } // namespace extensions 101 } // namespace extensions
102 102
103 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_GALLERY_WATCH_M ANAGER_H_ 103 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_GALLERY_WATCH_M ANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698