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

Unified Diff: chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc

Issue 170713007: Resubmit of 149313003: Significantly cleans up the ImageWriter Operation class and subclasses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes comments. Created 6 years, 10 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/extensions/api/image_writer_private/image_writer_private_api.cc
diff --git a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc
index 3d7fd423688ddbdcc07fa89df1ada1072e419dfb..cb08e5611c2f309a949caa6912e0334f7e784b02 100644
--- a/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc
+++ b/chrome/browser/extensions/api/image_writer_private/image_writer_private_api.cc
@@ -31,17 +31,6 @@ bool ImageWriterPrivateWriteFromUrlFunction::RunImpl() {
return false;
}
-#if defined(OS_CHROMEOS)
- // The Chrome OS temporary partition is too small for Chrome OS images, thus
- // we must always use the downloads folder.
- bool save_image_as_download = true;
-#else
- bool save_image_as_download = false;
- if (params->options.get() && params->options->save_as_download.get()) {
- save_image_as_download = true;
- }
-#endif
-
std::string hash;
if (params->options.get() && params->options->image_hash.get()) {
hash = *params->options->image_hash;
@@ -50,9 +39,7 @@ bool ImageWriterPrivateWriteFromUrlFunction::RunImpl() {
image_writer::OperationManager::Get(GetProfile())->StartWriteFromUrl(
extension_id(),
url,
- render_view_host(),
hash,
- save_image_as_download,
params->storage_unit_id,
base::Bind(&ImageWriterPrivateWriteFromUrlFunction::OnWriteStarted,
this));
@@ -89,11 +76,11 @@ bool ImageWriterPrivateWriteFromFileFunction::RunImpl() {
base::FilePath path;
if (!extensions::app_file_handler_util::ValidateFileEntryAndGetPath(
- filesystem_name,
- filesystem_path,
- render_view_host_,
- &path,
- &error_))
+ filesystem_name,
+ filesystem_path,
+ render_view_host(),
+ &path,
+ &error_))
return false;
image_writer::OperationManager::Get(GetProfile())->StartWriteFromFile(

Powered by Google App Engine
This is Rietveld 408576698