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

Side by Side Diff: chrome/browser/extensions/api/image_writer_private/operation_manager.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 27 matching lines...) Expand all
38 typedef std::string ExtensionId; 38 typedef std::string ExtensionId;
39 39
40 explicit OperationManager(Profile* profile); 40 explicit OperationManager(Profile* profile);
41 virtual ~OperationManager(); 41 virtual ~OperationManager();
42 42
43 virtual void Shutdown() OVERRIDE; 43 virtual void Shutdown() OVERRIDE;
44 44
45 // Starts a WriteFromUrl operation. 45 // Starts a WriteFromUrl operation.
46 void StartWriteFromUrl(const ExtensionId& extension_id, 46 void StartWriteFromUrl(const ExtensionId& extension_id,
47 GURL url, 47 GURL url,
48 content::RenderViewHost* rvh,
49 const std::string& hash, 48 const std::string& hash,
50 bool saveImageAsDownload, 49 const std::string& device_path,
51 const std::string& storage_unit_id,
52 const Operation::StartWriteCallback& callback); 50 const Operation::StartWriteCallback& callback);
53 51
54 // Starts a WriteFromFile operation. 52 // Starts a WriteFromFile operation.
55 void StartWriteFromFile(const ExtensionId& extension_id, 53 void StartWriteFromFile(const ExtensionId& extension_id,
56 const base::FilePath& path, 54 const base::FilePath& path,
57 const std::string& storage_unit_id, 55 const std::string& device_path,
58 const Operation::StartWriteCallback& callback); 56 const Operation::StartWriteCallback& callback);
59 57
60 // Cancels the extensions current operation if any. 58 // Cancels the extensions current operation if any.
61 void CancelWrite(const ExtensionId& extension_id, 59 void CancelWrite(const ExtensionId& extension_id,
62 const Operation::CancelWriteCallback& callback); 60 const Operation::CancelWriteCallback& callback);
63 61
64 // Starts a write that removes the partition table. 62 // Starts a write that removes the partition table.
65 void DestroyPartitions(const ExtensionId& extension_id, 63 void DestroyPartitions(const ExtensionId& extension_id,
66 const std::string& storage_unit_id, 64 const std::string& device_path,
67 const Operation::StartWriteCallback& callback); 65 const Operation::StartWriteCallback& callback);
68 66
69 // Callback for progress events. 67 // Callback for progress events.
70 virtual void OnProgress(const ExtensionId& extension_id, 68 virtual void OnProgress(const ExtensionId& extension_id,
71 image_writer_api::Stage stage, 69 image_writer_api::Stage stage,
72 int progress); 70 int progress);
73 // Callback for completion events. 71 // Callback for completion events.
74 virtual void OnComplete(const ExtensionId& extension_id); 72 virtual void OnComplete(const ExtensionId& extension_id);
75 73
76 // Callback for error events. 74 // Callback for error events.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 107
110 base::WeakPtrFactory<OperationManager> weak_factory_; 108 base::WeakPtrFactory<OperationManager> weak_factory_;
111 109
112 DISALLOW_COPY_AND_ASSIGN(OperationManager); 110 DISALLOW_COPY_AND_ASSIGN(OperationManager);
113 }; 111 };
114 112
115 } // namespace image_writer 113 } // namespace image_writer
116 } // namespace extensions 114 } // namespace extensions
117 115
118 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_ H_ 116 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_OPERATION_MANAGER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698