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

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

Issue 114193009: [Download] Return DownloadInterruptReason from OnStartedCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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_WRITE_FROM_URL_OPERAT ION_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_WRITE_FROM_URL_OPERAT ION_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_WRITE_FROM_URL_OPERAT ION_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_WRITE_FROM_URL_OPERAT ION_H_
7 7
8 #include "base/scoped_observer.h" 8 #include "base/scoped_observer.h"
9 #include "chrome/browser/extensions/api/image_writer_private/operation.h" 9 #include "chrome/browser/extensions/api/image_writer_private/operation.h"
10 #include "content/public/browser/download_interrupt_reasons.h"
10 #include "content/public/browser/download_item.h" 11 #include "content/public/browser/download_item.h"
11 #include "net/base/net_errors.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class RenderViewHost; 16 class RenderViewHost;
17 17
18 } // namespace content 18 } // namespace content
19 19
20 namespace extensions { 20 namespace extensions {
21 namespace image_writer { 21 namespace image_writer {
(...skipping 10 matching lines...) Expand all
32 GURL url, 32 GURL url,
33 const std::string& hash, 33 const std::string& hash,
34 bool saveImageAsDownload, 34 bool saveImageAsDownload,
35 const std::string& storage_unit_id); 35 const std::string& storage_unit_id);
36 virtual void Start() OVERRIDE; 36 virtual void Start() OVERRIDE;
37 private: 37 private:
38 virtual ~WriteFromUrlOperation(); 38 virtual ~WriteFromUrlOperation();
39 void CreateTempFile(); 39 void CreateTempFile();
40 40
41 void DownloadStart(); 41 void DownloadStart();
42 void OnDownloadStarted(content::DownloadItem*, net::Error); 42 void OnDownloadStarted(content::DownloadItem*,
43 content::DownloadInterruptReason interrupt_reason);
43 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; 44 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE;
44 void DownloadComplete(); 45 void DownloadComplete();
45 void DownloadCleanUp(); 46 void DownloadCleanUp();
46 47
47 void VerifyDownloadStart(); 48 void VerifyDownloadStart();
48 void VerifyDownloadRun(); 49 void VerifyDownloadRun();
49 void VerifyDownloadCompare(scoped_ptr<std::string> download_hash); 50 void VerifyDownloadCompare(scoped_ptr<std::string> download_hash);
50 void VerifyDownloadComplete(); 51 void VerifyDownloadComplete();
51 52
52 // Arguments 53 // Arguments
53 content::RenderViewHost* rvh_; 54 content::RenderViewHost* rvh_;
54 GURL url_; 55 GURL url_;
55 const std::string hash_; 56 const std::string hash_;
56 const bool saveImageAsDownload_; 57 const bool saveImageAsDownload_;
57 58
58 // Local state 59 // Local state
59 scoped_ptr<base::FilePath> tmp_file_; 60 scoped_ptr<base::FilePath> tmp_file_;
60 bool download_stopped_; 61 bool download_stopped_;
61 content::DownloadItem* download_; 62 content::DownloadItem* download_;
62 base::FilePath download_path_; 63 base::FilePath download_path_;
63 }; 64 };
64 65
65 } // namespace image_writer 66 } // namespace image_writer
66 } // namespace extensions 67 } // namespace extensions
67 68
68 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_WRITE_FROM_URL_OPE RATION_H_ 69 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_WRITE_FROM_URL_OPE RATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698