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

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

Issue 6674015: Added mount change notification callback: chrome.fileSystem.onChanged... (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 79456)
+++ chrome/browser/chromeos/usb_mount_observer.h (working copy)
@@ -1,86 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_
-#define CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_
-#pragma once
-
-#include <string>
-#include <map>
-#include <vector>
-
-#include "chrome/browser/chromeos/cros/mount_library.h"
-#include "content/common/notification_observer.h"
-#include "content/common/notification_registrar.h"
-#include "content/common/notification_source.h"
-#include "content/common/notification_type.h"
-
-class Browser;
-template <typename T> struct DefaultSingletonTraits;
-class Profile;
-
-namespace chromeos { // NOLINT
-
-// Used to monitor mount changes and popup a new window when
-// a new mounted usb device is found.
-class USBMountObserver : public MountLibrary::Observer,
- public NotificationObserver {
- public:
- struct BrowserWithPath {
- Browser* browser;
- std::string device_path;
- std::string mount_path;
- };
-
- static USBMountObserver* GetInstance();
-
- // NotificationObserver overrides.
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details);
-
- // MountLibrary::Observer overrides.
- virtual void DiskChanged(MountLibraryEventType event,
- const MountLibrary::Disk* disk);
- virtual void DeviceChanged(MountLibraryEventType event,
- const std::string& device_path);
-
- private:
- friend struct DefaultSingletonTraits<USBMountObserver>;
- typedef std::vector<BrowserWithPath>::iterator BrowserIterator;
- typedef std::map<std::string, std::string> MountPointMap;
-
- 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
- // of tracked browser windows in case that device goes away.
- void OpenFileBrowse(const std::string& url,
- const std::string& device_path,
- bool small);
-
- std::vector<BrowserWithPath> browsers_;
- NotificationRegistrar registrar_;
- MountPointMap mounted_devices_;
-
- DISALLOW_COPY_AND_ASSIGN(USBMountObserver);
-};
-
-} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_
« 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