OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/download/save_package.h" | 5 #include "content/browser/download/save_package.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 | 107 |
108 // Request handle for SavePackage downloads. Currently doesn't support | 108 // Request handle for SavePackage downloads. Currently doesn't support |
109 // pause/resume/cancel, but returns a WebContents. | 109 // pause/resume/cancel, but returns a WebContents. |
110 class SavePackageRequestHandle : public DownloadRequestHandleInterface { | 110 class SavePackageRequestHandle : public DownloadRequestHandleInterface { |
111 public: | 111 public: |
112 SavePackageRequestHandle(base::WeakPtr<SavePackage> save_package) | 112 SavePackageRequestHandle(base::WeakPtr<SavePackage> save_package) |
113 : save_package_(save_package) {} | 113 : save_package_(save_package) {} |
114 | 114 |
115 // DownloadRequestHandleInterface | 115 // DownloadRequestHandleInterface |
116 virtual WebContents* GetWebContents() const OVERRIDE { | 116 virtual WebContents* GetWebContents() const override { |
117 return save_package_.get() ? save_package_->web_contents() : NULL; | 117 return save_package_.get() ? save_package_->web_contents() : NULL; |
118 } | 118 } |
119 virtual DownloadManager* GetDownloadManager() const OVERRIDE { | 119 virtual DownloadManager* GetDownloadManager() const override { |
120 return NULL; | 120 return NULL; |
121 } | 121 } |
122 virtual void PauseRequest() const OVERRIDE {} | 122 virtual void PauseRequest() const override {} |
123 virtual void ResumeRequest() const OVERRIDE {} | 123 virtual void ResumeRequest() const override {} |
124 virtual void CancelRequest() const OVERRIDE {} | 124 virtual void CancelRequest() const override {} |
125 virtual std::string DebugString() const OVERRIDE { | 125 virtual std::string DebugString() const override { |
126 return "SavePackage DownloadRequestHandle"; | 126 return "SavePackage DownloadRequestHandle"; |
127 } | 127 } |
128 | 128 |
129 private: | 129 private: |
130 base::WeakPtr<SavePackage> save_package_; | 130 base::WeakPtr<SavePackage> save_package_; |
131 }; | 131 }; |
132 | 132 |
133 } // namespace | 133 } // namespace |
134 | 134 |
135 const base::FilePath::CharType SavePackage::kDefaultHtmlExtension[] = | 135 const base::FilePath::CharType SavePackage::kDefaultHtmlExtension[] = |
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 | 1436 |
1437 void SavePackage::FinalizeDownloadEntry() { | 1437 void SavePackage::FinalizeDownloadEntry() { |
1438 DCHECK(download_); | 1438 DCHECK(download_); |
1439 DCHECK(download_manager_); | 1439 DCHECK(download_manager_); |
1440 | 1440 |
1441 download_manager_->OnSavePackageSuccessfullyFinished(download_); | 1441 download_manager_->OnSavePackageSuccessfullyFinished(download_); |
1442 StopObservation(); | 1442 StopObservation(); |
1443 } | 1443 } |
1444 | 1444 |
1445 } // namespace content | 1445 } // namespace content |
OLD | NEW |