1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
6 #define CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
10 #include "chrome/utility/image_writer/image_writer.h"
11 #include "chrome/utility/utility_message_handler.h"
12 #include "ipc/ipc_message.h"
18 namespace image_writer
{
20 // A handler for messages related to writing images. This class is added as a
21 // handler in ChromeContentUtilityClient.
22 class ImageWriterHandler
: public UtilityMessageHandler
{
25 virtual ~ImageWriterHandler();
27 // Methods for sending the different messages back to the browser process.
28 // Generally should be called by chrome::image_writer::ImageWriter.
29 virtual void SendSucceeded();
30 virtual void SendCancelled();
31 virtual void SendFailed(const std::string
& message
);
32 virtual void SendProgress(int64 progress
);
35 virtual bool OnMessageReceived(const IPC::Message
& message
) OVERRIDE
;
37 // Small wrapper for sending on the UtilityProcess.
38 void Send(IPC::Message
* msg
);
41 void OnWriteStart(const base::FilePath
& image
, const base::FilePath
& device
);
42 void OnVerifyStart(const base::FilePath
& image
, const base::FilePath
& device
);
45 scoped_ptr
<ImageWriter
> image_writer_
;
48 } // namespace image_writer
50 #endif // CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_