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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_event_router.h

Issue 7457001: Adding support for mount point different from removable devices to MountLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 26 matching lines...) Expand all
37 37
38 // File watch setup routines. 38 // File watch setup routines.
39 bool AddFileWatch(const FilePath& file_path, 39 bool AddFileWatch(const FilePath& file_path,
40 const FilePath& virtual_path, 40 const FilePath& virtual_path,
41 const std::string& extension_id); 41 const std::string& extension_id);
42 void RemoveFileWatch(const FilePath& file_path, 42 void RemoveFileWatch(const FilePath& file_path,
43 const std::string& extension_id); 43 const std::string& extension_id);
44 44
45 // MountLibrary::Observer overrides. 45 // MountLibrary::Observer overrides.
46 virtual void DiskChanged(chromeos::MountLibraryEventType event, 46 virtual void DiskChanged(chromeos::MountLibraryEventType event,
47 const chromeos::MountLibrary::Disk* disk); 47 const chromeos::MountLibrary::Disk* disk) OVERRIDE;
48 virtual void DeviceChanged(chromeos::MountLibraryEventType event, 48 virtual void DeviceChanged(chromeos::MountLibraryEventType event,
49 const std::string& device_path); 49 const std::string& device_path) OVERRIDE;
50 virtual void MountCompleted(chromeos::MountLibrary::MountEvent event_type,
51 chromeos::MountError error_code,
52 const std::string& source_path,
53 chromeos::MountType type,
54 const std::string& mount_path) OVERRIDE;
50 55
51 private: 56 private:
52 friend struct DefaultSingletonTraits<ExtensionFileBrowserEventRouter>; 57 friend struct DefaultSingletonTraits<ExtensionFileBrowserEventRouter>;
53 typedef std::map<std::string, linked_ptr<chromeos::SystemNotification> > 58 typedef std::map<std::string, linked_ptr<chromeos::SystemNotification> >
54 NotificationMap; 59 NotificationMap;
55 typedef std::map<std::string, std::string> MountPointMap; 60 typedef std::map<std::string, std::string> MountPointMap;
56 typedef struct FileWatcherExtensions { 61 typedef struct FileWatcherExtensions {
57 FileWatcherExtensions(const FilePath& path, const std::string& extension_id) { 62 FileWatcherExtensions(const FilePath& path, const std::string& extension_id) {
58 file_watcher.reset(new base::files::FilePathWatcher()); 63 file_watcher.reset(new base::files::FilePathWatcher());
59 virtual_path = path; 64 virtual_path = path;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void HandleFileWatchNotification(const FilePath& path, 104 void HandleFileWatchNotification(const FilePath& path,
100 bool got_error); 105 bool got_error);
101 106
102 // Sends folder change event. 107 // Sends folder change event.
103 void DispatchFolderChangeEvent(const FilePath& path, bool error, 108 void DispatchFolderChangeEvent(const FilePath& path, bool error,
104 const std::set<std::string>& extensions); 109 const std::set<std::string>& extensions);
105 110
106 // Sends filesystem changed extension message to all renderers. 111 // Sends filesystem changed extension message to all renderers.
107 void DispatchMountEvent(const chromeos::MountLibrary::Disk* disk, bool added); 112 void DispatchMountEvent(const chromeos::MountLibrary::Disk* disk, bool added);
108 113
114 void DispatchMountCompletedEvent(chromeos::MountLibrary::MountEvent event,
115 chromeos::MountError error_code,
116 const std::string& source_path,
117 chromeos::MountType mount_type,
118 const std::string& mount_path);
119
109 void RemoveBrowserFromVector(const std::string& path); 120 void RemoveBrowserFromVector(const std::string& path);
110 121
111 // Used to create a window of a standard size, and add it to a list 122 // Used to create a window of a standard size, and add it to a list
112 // of tracked browser windows in case that device goes away. 123 // of tracked browser windows in case that device goes away.
113 void OpenFileBrowse(const std::string& url, 124 void OpenFileBrowse(const std::string& url,
114 const std::string& device_path, 125 const std::string& device_path,
115 bool small); 126 bool small);
116 127
117 // Show/hide desktop notifications. 128 // Show/hide desktop notifications.
118 void ShowDeviceNotification(const std::string& system_path, 129 void ShowDeviceNotification(const std::string& system_path,
119 int icon_resource_id, 130 int icon_resource_id,
120 const string16& message); 131 const string16& message);
121 void HideDeviceNotification(const std::string& system_path); 132 void HideDeviceNotification(const std::string& system_path);
122 133
123 scoped_refptr<FileWatcherDelegate> delegate_; 134 scoped_refptr<FileWatcherDelegate> delegate_;
124 MountPointMap mounted_devices_; 135 MountPointMap mounted_devices_;
125 NotificationMap notifications_; 136 NotificationMap notifications_;
126 WatcherMap file_watchers_; 137 WatcherMap file_watchers_;
127 Profile* profile_; 138 Profile* profile_;
128 base::Lock lock_; 139 base::Lock lock_;
129 140
130 DISALLOW_COPY_AND_ASSIGN(ExtensionFileBrowserEventRouter); 141 DISALLOW_COPY_AND_ASSIGN(ExtensionFileBrowserEventRouter);
131 }; 142 };
132 143
133 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ 144 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698