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

Unified Diff: chrome/utility/image_writer/image_writer_handler.h

Issue 61643015: Adds imageWriterPrivate support for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes test cleanup ordering for Chrome OS. 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
« no previous file with comments | « chrome/utility/image_writer/image_writer.cc ('k') | chrome/utility/image_writer/image_writer_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/image_writer/image_writer_handler.h
diff --git a/chrome/utility/image_writer/image_writer_handler.h b/chrome/utility/image_writer/image_writer_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..5763f96d1969ae4a539304a2b705d46813afe92f
--- /dev/null
+++ b/chrome/utility/image_writer/image_writer_handler.h
@@ -0,0 +1,51 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
+#define CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
+
+#include "chrome/utility/image_writer/image_writer.h"
+#include "chrome/utility/utility_message_handler.h"
+#include "ipc/ipc_message.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace image_writer {
+
+// A handler for messages related to writing images. This class is added as a
+// handler in chrome::ChromeContentUtilityClient.
+class ImageWriterHandler : public chrome::UtilityMessageHandler {
+ public:
+ ImageWriterHandler();
+ virtual ~ImageWriterHandler();
+
+ // Methods for sending the different messages back to the browser process.
+ // Generally should be called by chrome::image_writer::ImageWriter.
+ virtual void SendSucceeded();
+ virtual void SendCancelled();
+ virtual void SendFailed(const std::string& message);
+ virtual void SendProgress(int64 progress);
+
+ private:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // Small wrapper for sending on the UtilityProcess.
+ void Send(IPC::Message* msg);
+
+ // Message handlers.
+ void OnWriteStart(const base::FilePath& image, const base::FilePath& device);
+ void OnVerifyStart(const base::FilePath& image, const base::FilePath& device);
+ void OnCancel();
+
+ // Checks if a path is a valid target device.
+ bool IsValidDevice(const base::FilePath& device);
+
+ ImageWriter image_writer_;
+};
+
+} // namespace image_writer
+
+#endif // CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
« no previous file with comments | « chrome/utility/image_writer/image_writer.cc ('k') | chrome/utility/image_writer/image_writer_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698