diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 02:54:27 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-17 02:54:27 +0000 |
commit | 07f11f842675a0c9ccbc3ebb19d4c395ea907754 (patch) | |
tree | 5ab82aed645408d9b9cf995ba79d9088bfb3c4ec /chrome/browser/chromeos/extensions/file_browser_event_router.h | |
parent | fe72fa7abb8f92d130346d1fe2c9609ed5260ac4 (diff) | |
download | chromium_src-07f11f842675a0c9ccbc3ebb19d4c395ea907754.zip chromium_src-07f11f842675a0c9ccbc3ebb19d4c395ea907754.tar.gz chromium_src-07f11f842675a0c9ccbc3ebb19d4c395ea907754.tar.bz2 |
Revert 127317 - Implemented API for tracking ongoing file transfers from file manager.
new method:
chrome.fileManagerPrivate.getFileTransfers(function(transfers) {
});
new event:
chrome.fileManagerPrivate.onFileTransfersUpdated.addListener(function(transfers) {
});
where:
transfers = [
{
'fileUrl': 'filesystem://.../external/gdata/myfile.txt',
'transferState': 'started|in_progress|completed|failed',
'transferType': 'upload|download',
'processed': 1234,
'total': 54331
},
...
]
BUG=chromium-os:27819
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9703042
TBR=zelidrag@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9719012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/extensions/file_browser_event_router.h')
-rw-r--r-- | chrome/browser/chromeos/extensions/file_browser_event_router.h | 56 |
1 files changed, 8 insertions, 48 deletions
diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.h b/chrome/browser/chromeos/extensions/file_browser_event_router.h index 199338d..e546455 100644 --- a/chrome/browser/chromeos/extensions/file_browser_event_router.h +++ b/chrome/browser/chromeos/extensions/file_browser_event_router.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// 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. @@ -16,24 +16,17 @@ #include "base/string16.h" #include "base/synchronization/lock.h" #include "chrome/browser/chromeos/disks/disk_mount_manager.h" -#include "chrome/browser/chromeos/gdata/gdata_file_system.h" -#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" class FileBrowserNotifications; class Profile; // Used to monitor disk mount changes and signal when new mounted usb device is // found. -class FileBrowserEventRouter - : public ProfileKeyedService, - public chromeos::disks::DiskMountManager::Observer, - public gdata::GDataOperationRegistry::Observer { +class ExtensionFileBrowserEventRouter + : public chromeos::disks::DiskMountManager::Observer { public: - // ProfileKeyedService overrides. - virtual void Shutdown() OVERRIDE; - + explicit ExtensionFileBrowserEventRouter(Profile* profile); + virtual ~ExtensionFileBrowserEventRouter(); // Starts observing file system change events. Currently only // CrosDisksClient events are being observed. void ObserveFileSystemEvents(); @@ -57,18 +50,11 @@ class FileBrowserEventRouter const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) OVERRIDE; - // GDataOperationRegistry::Observer overrides. - virtual void OnProgressUpdate( - const std::vector<gdata::GDataOperationRegistry::ProgressStatus>& list) - OVERRIDE; - private: - friend class FileBrowserEventRouterFactory; - // Helper class for passing through file watch notification events. class FileWatcherDelegate : public base::files::FilePathWatcher::Delegate { public: - explicit FileWatcherDelegate(FileBrowserEventRouter* router); + explicit FileWatcherDelegate(ExtensionFileBrowserEventRouter* router); private: // base::files::FilePathWatcher::Delegate overrides. @@ -77,7 +63,7 @@ class FileBrowserEventRouter void HandleFileWatchOnUIThread(const FilePath& local_path, bool got_error); - FileBrowserEventRouter* router_; + ExtensionFileBrowserEventRouter* router_; }; typedef std::map<std::string, int> ExtensionUsageRegistry; @@ -111,9 +97,6 @@ class FileBrowserEventRouter typedef std::map<FilePath, FileWatcherExtensions*> WatcherMap; - explicit FileBrowserEventRouter(Profile* profile); - virtual ~FileBrowserEventRouter(); - // USB mount event handlers. void OnDiskAdded(const chromeos::disks::DiskMountManager::Disk* disk); void OnDiskRemoved(const chromeos::disks::DiskMountManager::Disk* disk); @@ -156,30 +139,7 @@ class FileBrowserEventRouter Profile* profile_; base::Lock lock_; - DISALLOW_COPY_AND_ASSIGN(FileBrowserEventRouter); -}; - -// Singleton that owns all FileBrowserEventRouter and associates -// them with Profiles. -class FileBrowserEventRouterFactory - : public ProfileKeyedServiceFactory { - public: - // Returns the FileBrowserEventRouter for |profile|, creating it if - // it is not yet created. - static FileBrowserEventRouter* GetForProfile(Profile* profile); - - // Returns the FileBrowserEventRouterFactory instance. - static FileBrowserEventRouterFactory* GetInstance(); - - private: - friend struct DefaultSingletonTraits<FileBrowserEventRouterFactory>; - - FileBrowserEventRouterFactory(); - virtual ~FileBrowserEventRouterFactory(); - - // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + DISALLOW_COPY_AND_ASSIGN(ExtensionFileBrowserEventRouter); }; #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ |