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

Unified Diff: chrome/browser/chromeos/usb_mount_observer.h

Issue 6674043: Rewritten MountLibrary to work with non-blocking mount API calls in libcros.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/cros/mount_library.cc ('k') | chrome/browser/chromeos/usb_mount_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/usb_mount_observer.h
===================================================================
--- chrome/browser/chromeos/usb_mount_observer.h (revision 78562)
+++ chrome/browser/chromeos/usb_mount_observer.h (working copy)
@@ -7,6 +7,7 @@
#pragma once
#include <string>
+#include <map>
#include <vector>
#include "chrome/browser/chromeos/cros/mount_library.h"
@@ -23,7 +24,7 @@
// Used to monitor mount changes and popup a new window when
// a new mounted usb device is found.
-class USBMountObserver : public chromeos::MountLibrary::Observer,
+class USBMountObserver : public MountLibrary::Observer,
public NotificationObserver {
public:
struct BrowserWithPath {
@@ -34,24 +35,38 @@
static USBMountObserver* GetInstance();
- void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details);
+ // NotificationObserver overrides.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
- void MountChanged(chromeos::MountLibrary* obj,
- chromeos::MountEventType evt,
- const std::string& path);
+ // MountLibrary::Observer overrides.
+ virtual void DiskChanged(MountLibraryEventType event,
+ const MountLibrary::Disk* disk);
+ virtual void DeviceChanged(MountLibraryEventType event,
+ const std::string& device_path);
- void ScanForDevices(chromeos::MountLibrary* obj);
-
private:
friend struct DefaultSingletonTraits<USBMountObserver>;
typedef std::vector<BrowserWithPath>::iterator BrowserIterator;
- BrowserIterator FindBrowserForPath(const std::string& path);
+ typedef std::map<std::string, std::string> MountPointMap;
USBMountObserver() {}
- ~USBMountObserver() {}
+ virtual ~USBMountObserver() {}
+ // USB mount event handlers.
+ void OnDiskAdded(const MountLibrary::Disk* disk);
+ void OnDiskRemoved(const MountLibrary::Disk* disk);
+ void OnDiskChanged(const MountLibrary::Disk* disk);
+ void OnDeviceAdded(const std::string& device_path);
+ void OnDeviceRemoved(const std::string& device_path);
+ void OnDeviceScanned(const std::string& device_path);
+
+ BrowserIterator FindBrowserForPath(const std::string& path);
+
+ // Sends filesystem changed extension message to all renderers.
+ void FireFileSystemChanged(const std::string& web_path);
+
void RemoveBrowserFromVector(const std::string& path);
// Used to create a window of a standard size, and add it to a list
@@ -62,6 +77,7 @@
std::vector<BrowserWithPath> browsers_;
NotificationRegistrar registrar_;
+ MountPointMap mounted_devices_;
DISALLOW_COPY_AND_ASSIGN(USBMountObserver);
};
« no previous file with comments | « chrome/browser/chromeos/cros/mount_library.cc ('k') | chrome/browser/chromeos/usb_mount_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698