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

Side by Side Diff: chrome/browser/media_gallery/media_file_system_registry.h

Issue 10827057: Plumb file system name down from MediaFileSystemRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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 // MediaFileSystemRegistry registers pictures directories and media devices as 5 // MediaFileSystemRegistry registers pictures directories and media devices as
6 // File API filesystems and keeps track of the path to filesystem ID mappings. 6 // File API filesystems and keeps track of the path to filesystem ID mappings.
7 7
8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ 8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_
9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ 9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_
10 10
(...skipping 21 matching lines...) Expand all
32 namespace fileapi { 32 namespace fileapi {
33 class IsolatedContext; 33 class IsolatedContext;
34 } 34 }
35 35
36 namespace chrome { 36 namespace chrome {
37 37
38 class MediaFileSystemRegistry 38 class MediaFileSystemRegistry
39 : public base::SystemMonitor::DevicesChangedObserver, 39 : public base::SystemMonitor::DevicesChangedObserver,
40 public content::NotificationObserver { 40 public content::NotificationObserver {
41 public: 41 public:
42 // (Filesystem ID, path) 42 struct MediaFSInfo {
43 typedef std::pair<std::string, FilePath> MediaFSIDAndPath; 43 std::string name;
44 std::string fsid;
45 FilePath path;
46 };
44 47
45 // The instance is lazily created per browser process. 48 // The instance is lazily created per browser process.
46 static MediaFileSystemRegistry* GetInstance(); 49 static MediaFileSystemRegistry* GetInstance();
47 50
48 // Returns the list of media filesystem IDs and paths for a given RPH. 51 // Returns the list of media filesystem IDs and paths for a given RPH.
49 // Called on the UI thread. 52 // Called on the UI thread.
50 std::vector<MediaFSIDAndPath> GetMediaFileSystems( 53 std::vector<MediaFSInfo> GetMediaFileSystemsForExtension(
51 const content::RenderProcessHost* rph, 54 const content::RenderProcessHost* rph,
52 const extensions::Extension& extension); 55 const extensions::Extension& extension);
53 56
54 // base::SystemMonitor::DevicesChangedObserver implementation. 57 // base::SystemMonitor::DevicesChangedObserver implementation.
55 virtual void OnMediaDeviceDetached(const std::string& id) OVERRIDE; 58 virtual void OnMediaDeviceDetached(const std::string& id) OVERRIDE;
56 59
57 // content::NotificationObserver implementation. 60 // content::NotificationObserver implementation.
58 virtual void Observe(int type, 61 virtual void Observe(int type,
59 const content::NotificationSource& source, 62 const content::NotificationSource& source,
60 const content::NotificationDetails& details) OVERRIDE; 63 const content::NotificationDetails& details) OVERRIDE;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 98
96 // Is only used on the UI thread. 99 // Is only used on the UI thread.
97 content::NotificationRegistrar registrar_; 100 content::NotificationRegistrar registrar_;
98 101
99 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); 102 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry);
100 }; 103 };
101 104
102 } // namespace chrome 105 } // namespace chrome
103 106
104 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ 107 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698