#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
-#include "base/strings/stringprintf.h"
#include "base/task_runner_util.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/file_cache.h"
+#include "chrome/browser/chromeos/drive/file_change.h"
#include "chrome/browser/chromeos/drive/file_errors.h"
-#include "chrome/browser/chromeos/drive/file_system/operation_observer.h"
+#include "chrome/browser/chromeos/drive/file_system/operation_delegate.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/drive/job_scheduler.h"
-#include "chrome/browser/chromeos/drive/resource_entry_conversion.h"
#include "chrome/browser/chromeos/drive/resource_metadata.h"
#include "content/public/browser/browser_thread.h"
#include "google_apis/drive/gdata_errorcode.h"
base::FilePath::StringType extension = base::FilePath::FromUTF8Unsafe(
entry->file_specific_info().document_extension()).value();
base::FilePath gdoc_file_path;
- // TODO(rvargas): Convert this code to use base::File::Info.
base::File::Info file_info;
// We add the gdoc file extension in the temporary file, so that in cross
// profile drag-and-drop between Drive folders, the destination profiles's
DownloadOperation::DownloadOperation(
base::SequencedTaskRunner* blocking_task_runner,
- OperationObserver* observer,
+ OperationDelegate* delegate,
JobScheduler* scheduler,
internal::ResourceMetadata* metadata,
internal::FileCache* cache,
const base::FilePath& temporary_file_directory)
: blocking_task_runner_(blocking_task_runner),
- observer_(observer),
+ delegate_(delegate),
scheduler_(scheduler),
metadata_(metadata),
cache_(cache),
params->OnError(error);
return;
}
+ DCHECK(!entry_after_update->file_info().is_directory());
+ FileChange changed_files;
+ changed_files.Update(
+ file_path, FileChange::FILE_TYPE_FILE, FileChange::ADD_OR_UPDATE);
// Storing to cache changes the "offline available" status, hence notify.
- observer_->OnDirectoryChangedByOperation(file_path.DirName());
+ delegate_->OnFileChangedByOperation(changed_files);
params->OnDownloadCompleted(*cache_file_path, entry_after_update.Pass());
}