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

Unified Diff: chrome/browser/chromeos/drive/file_system.cc

Issue 22335004: Add drive::FileSystem::GetFileByPathForSaving(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
Index: chrome/browser/chromeos/drive/file_system.cc
diff --git a/chrome/browser/chromeos/drive/file_system.cc b/chrome/browser/chromeos/drive/file_system.cc
index 6b89008e063ea66dbc509f3ab987b1eb5dca62ba..7088a85b37332e68a06a9c0404ede4393879623c 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"
@@ -29,6 +30,7 @@
#include "chrome/browser/chromeos/drive/file_system/update_operation.h"
#include "chrome/browser/chromeos/drive/file_system_observer.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
+#include "chrome/browser/chromeos/drive/file_write_watcher.h"
#include "chrome/browser/chromeos/drive/job_scheduler.h"
#include "chrome/browser/chromeos/drive/remove_stale_cache_files.h"
#include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
@@ -208,13 +210,21 @@ 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_));
-
+ file_write_watcher_.reset(new internal::FileWriteWatcher(observer));
hashimoto 2013/08/07 10:31:54 What is this watcher serving for?
kinaba 2013/08/07 11:28:38 Oops. I forgot to remove this prototype impl of mi
hide_hosted_docs_ =
pref_service_->GetBoolean(prefs::kDisableDriveHostedFiles);
@@ -491,6 +501,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,

Powered by Google App Engine
This is Rietveld 408576698