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

Side by Side Diff: content/browser/download/save_package.cc

Issue 1728583002: Simplify DownloadRequestHandle by using WebContentsGetter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: default callback constructor Created 4 years, 9 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 (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 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 : save_package_(save_package) {} 124 : save_package_(save_package) {}
125 125
126 // DownloadRequestHandleInterface 126 // DownloadRequestHandleInterface
127 WebContents* GetWebContents() const override { 127 WebContents* GetWebContents() const override {
128 return save_package_.get() ? save_package_->web_contents() : NULL; 128 return save_package_.get() ? save_package_->web_contents() : NULL;
129 } 129 }
130 DownloadManager* GetDownloadManager() const override { return NULL; } 130 DownloadManager* GetDownloadManager() const override { return NULL; }
131 void PauseRequest() const override {} 131 void PauseRequest() const override {}
132 void ResumeRequest() const override {} 132 void ResumeRequest() const override {}
133 void CancelRequest() const override {} 133 void CancelRequest() const override {}
134 std::string DebugString() const override {
135 return "SavePackage DownloadRequestHandle";
136 }
137 134
138 private: 135 private:
139 base::WeakPtr<SavePackage> save_package_; 136 base::WeakPtr<SavePackage> save_package_;
140 }; 137 };
141 138
142 } // namespace 139 } // namespace
143 140
144 const base::FilePath::CharType SavePackage::kDefaultHtmlExtension[] = 141 const base::FilePath::CharType SavePackage::kDefaultHtmlExtension[] =
145 FILE_PATH_LITERAL("html"); 142 FILE_PATH_LITERAL("html");
146 143
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 1512
1516 void SavePackage::FinalizeDownloadEntry() { 1513 void SavePackage::FinalizeDownloadEntry() {
1517 DCHECK(download_); 1514 DCHECK(download_);
1518 DCHECK(download_manager_); 1515 DCHECK(download_manager_);
1519 1516
1520 download_manager_->OnSavePackageSuccessfullyFinished(download_); 1517 download_manager_->OnSavePackageSuccessfullyFinished(download_);
1521 StopObservation(); 1518 StopObservation();
1522 } 1519 }
1523 1520
1524 } // namespace content 1521 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_resource_handler.cc ('k') | content/browser/download/url_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698