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

Side by Side Diff: chrome/browser/prerender/prerender_contents.cc

Issue 286543002: Cleanup CanDownload WebContentsDelegate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary include Created 6 years, 7 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 "chrome/browser/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL); 127 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL);
128 return NULL; 128 return NULL;
129 } 129 }
130 130
131 virtual void CloseContents(content::WebContents* contents) OVERRIDE { 131 virtual void CloseContents(content::WebContents* contents) OVERRIDE {
132 prerender_contents_->Destroy(FINAL_STATUS_CLOSED); 132 prerender_contents_->Destroy(FINAL_STATUS_CLOSED);
133 } 133 }
134 134
135 virtual void CanDownload( 135 virtual void CanDownload(
136 RenderViewHost* render_view_host, 136 RenderViewHost* render_view_host,
137 int request_id, 137 const GURL& url,
138 const std::string& request_method, 138 const std::string& request_method,
139 const base::Callback<void(bool)>& callback) OVERRIDE { 139 const base::Callback<void(bool)>& callback) OVERRIDE {
140 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); 140 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD);
141 // Cancel the download. 141 // Cancel the download.
142 callback.Run(false); 142 callback.Run(false);
143 } 143 }
144 144
145 virtual bool ShouldCreateWebContents( 145 virtual bool ShouldCreateWebContents(
146 WebContents* web_contents, 146 WebContents* web_contents,
147 int route_id, 147 int route_id,
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 void PrerenderContents::AddResourceThrottle( 878 void PrerenderContents::AddResourceThrottle(
879 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { 879 const base::WeakPtr<PrerenderResourceThrottle>& throttle) {
880 resource_throttles_.push_back(throttle); 880 resource_throttles_.push_back(throttle);
881 } 881 }
882 882
883 void PrerenderContents::AddNetworkBytes(int64 bytes) { 883 void PrerenderContents::AddNetworkBytes(int64 bytes) {
884 network_bytes_ += bytes; 884 network_bytes_ += bytes;
885 } 885 }
886 886
887 } // namespace prerender 887 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698