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

Side by Side 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: Cleanup and now working on Windows with minimal changes. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this image code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
6 #define CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
7
8 #include "base/files/file_path.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/utility/utility_message_handler.h"
11 #include "ipc/ipc_message.h"
12
13 namespace chrome {
14 namespace image_writer {
15
16 class ImageWriter;
17
18 // A handler for messages related to writing images. This class is added as a
19 // handler in |chrome::ChromeContentUtilityClient.
20 class ImageWriterHandler : public UtilityMessageHandler {
21 public:
22 ImageWriterHandler();
23 virtual ~ImageWriterHandler();
24
25 // Methods for sending the different messages back to the browser process.
26 // Generally should be called by chrome::image_writer::ImageWriter.
27 virtual void SendSucceeded();
28 virtual void SendCancelled();
29 virtual void SendFailed(const std::string& message);
30 virtual void SendProgress(int64 progress);
31
32 private:
33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
34
35 void Send(IPC::Message* msg);
36 void OnWriteStart(const base::FilePath& image, const base::FilePath& device);
37 void OnVerifyStart(const base::FilePath& image, const base::FilePath& device);
38 void OnCancel();
39
40 scoped_refptr<ImageWriter> image_writer_;
41 base::WeakPtrFactory<ImageWriterHandler> weak_factory_;
42 };
43
44 } // namespace image_writer
45 } // namespace chrome
46
47 #endif // CHROME_UTILITY_IMAGE_WRITER_IMAGE_WRITER_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698