diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-08 11:19:57 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-08 11:19:57 +0000 |
commit | 67d35b02236148e5b696b38ea9aceb77de9d16a4 (patch) | |
tree | f39da1746850cca8fed0d45749ce0df043f7b585 /chrome/browser/chromeos/drive/file_system.cc | |
parent | 3aacc9c9ec7d8c3124c8263d0f70bcf3c2cb2866 (diff) | |
download | chromium_src-67d35b02236148e5b696b38ea9aceb77de9d16a4.zip chromium_src-67d35b02236148e5b696b38ea9aceb77de9d16a4.tar.gz chromium_src-67d35b02236148e5b696b38ea9aceb77de9d16a4.tar.bz2 |
Add drive::FileSystem::GetFileByPathForSaving().
This is a part of the effort to enable Drive in the Save-As dialog of
Chrome OS for every call site. For that, we need to care about existing
callers that just simply write to local file paths returned by the dialog.
By calling the newly added method, Drive file system will return a local
cache whose modification is monitored for syncing.
BUG=140425
Review URL: https://chromiumcodereview.appspot.com/22335004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/drive/file_system.cc')
-rw-r--r-- | chrome/browser/chromeos/drive/file_system.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/drive/file_system.cc b/chrome/browser/chromeos/drive/file_system.cc index 6b89008..b6f4e93 100644 --- a/chrome/browser/chromeos/drive/file_system.cc +++ b/chrome/browser/chromeos/drive/file_system.cc @@ -20,6 +20,7 @@ #include "chrome/browser/chromeos/drive/file_system/create_directory_operation.h" #include "chrome/browser/chromeos/drive/file_system/create_file_operation.h" #include "chrome/browser/chromeos/drive/file_system/download_operation.h" +#include "chrome/browser/chromeos/drive/file_system/get_file_for_saving_operation.h" #include "chrome/browser/chromeos/drive/file_system/move_operation.h" #include "chrome/browser/chromeos/drive/file_system/open_file_operation.h" #include "chrome/browser/chromeos/drive/file_system/remove_operation.h" @@ -208,13 +209,20 @@ void FileSystem::Initialize() { cache_)); search_operation_.reset(new file_system::SearchOperation( blocking_task_runner_.get(), scheduler_, resource_metadata_)); + get_file_for_saving_operation_.reset( + new file_system::GetFileForSavingOperation(blocking_task_runner_.get(), + observer, + scheduler_, + resource_metadata_, + cache_, + temporary_file_directory_)); + sync_client_.reset(new internal::SyncClient(blocking_task_runner_.get(), observer, scheduler_, resource_metadata_, cache_, temporary_file_directory_)); - hide_hosted_docs_ = pref_service_->GetBoolean(prefs::kDisableDriveHostedFiles); @@ -491,6 +499,14 @@ void FileSystem::GetFileByPath(const base::FilePath& file_path, callback); } +void FileSystem::GetFileByPathForSaving(const base::FilePath& file_path, + const GetFileCallback& callback) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK(!callback.is_null()); + + get_file_for_saving_operation_->GetFileForSaving(file_path, callback); +} + void FileSystem::GetFileContentByPath( const base::FilePath& file_path, const GetFileContentInitializedCallback& initialized_callback, |