| Index: chrome/browser/chromeos/extensions/file_browser_private_api.cc
|
| ===================================================================
|
| --- chrome/browser/chromeos/extensions/file_browser_private_api.cc (revision 127341)
|
| +++ chrome/browser/chromeos/extensions/file_browser_private_api.cc (working copy)
|
| @@ -17,6 +17,7 @@
|
| #include "chrome/browser/chromeos/extensions/file_handler_util.h"
|
| #include "chrome/browser/chromeos/extensions/file_manager_util.h"
|
| #include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h"
|
| +#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h"
|
| #include "chrome/browser/chromeos/gdata/gdata_util.h"
|
| #include "chrome/browser/extensions/extension_function_dispatcher.h"
|
| #include "chrome/browser/extensions/extension_process_manager.h"
|
| @@ -60,6 +61,7 @@
|
| using content::SiteInstance;
|
| using content::WebContents;
|
| using file_handler_util::FileTaskExecutor;
|
| +using gdata::GDataOperationRegistry;
|
|
|
| namespace {
|
|
|
| @@ -522,7 +524,7 @@
|
| const FilePath& local_path, const FilePath& virtual_path,
|
| const std::string& extension_id) {
|
| #if defined(OS_CHROMEOS)
|
| - return profile_->GetExtensionService()->file_browser_event_router()->
|
| + return FileBrowserEventRouterFactory::GetForProfile(profile_)->
|
| AddFileWatch(local_path, virtual_path, extension_id);
|
| #else
|
| return true;
|
| @@ -533,7 +535,7 @@
|
| const FilePath& local_path, const FilePath& unused,
|
| const std::string& extension_id) {
|
| #if defined(OS_CHROMEOS)
|
| - profile_->GetExtensionService()->file_browser_event_router()->
|
| + FileBrowserEventRouterFactory::GetForProfile(profile_)->
|
| RemoveFileWatch(local_path, extension_id);
|
| #endif
|
| return true;
|
| @@ -1004,10 +1006,8 @@
|
| chromeos::MOUNT_TYPE_GDATA,
|
| chromeos::disks::MOUNT_CONDITION_NONE);
|
| // Raise mount event
|
| - profile_->GetExtensionService()->file_browser_event_router()->MountCompleted(
|
| - DiskMountManager::MOUNTING,
|
| - error_code,
|
| - mount_info);
|
| + FileBrowserEventRouterFactory::GetForProfile(profile_)->
|
| + MountCompleted(DiskMountManager::MOUNTING, error_code, mount_info);
|
| }
|
|
|
| void AddMountFunction::OnGDataAuthentication(gdata::GDataErrorCode error,
|
| @@ -1714,3 +1714,32 @@
|
| // Start getting the next file.
|
| GetFileOrSendResponse();
|
| }
|
| +
|
| +GetFileTransfersFunction::GetFileTransfersFunction() {}
|
| +
|
| +GetFileTransfersFunction::~GetFileTransfersFunction() {}
|
| +
|
| +ListValue* GetFileTransfersFunction::GetFileTransfersList() {
|
| + gdata::GDataFileSystem* file_system =
|
| + gdata::GDataFileSystemFactory::GetForProfile(profile_);
|
| + if (!file_system)
|
| + return NULL;
|
| +
|
| + std::vector<gdata::GDataOperationRegistry::ProgressStatus>
|
| + list = file_system->GetProgressStatusList();
|
| + return file_manager_util::ProgressStatusVectorToListValue(
|
| + profile_, source_url_.GetOrigin(), list);
|
| +}
|
| +
|
| +bool GetFileTransfersFunction::RunImpl() {
|
| + scoped_ptr<ListValue> progress_status_list(GetFileTransfersList());
|
| + if (!progress_status_list.get()) {
|
| + SendResponse(false);
|
| + return false;
|
| + }
|
| +
|
| + result_.reset(progress_status_list.release());
|
| + SendResponse(true);
|
| + return true;
|
| +}
|
| +
|
|
|