| 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 "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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL); | 129 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL); |
| 130 return NULL; | 130 return NULL; |
| 131 } | 131 } |
| 132 | 132 |
| 133 virtual void CloseContents(content::WebContents* contents) OVERRIDE { | 133 virtual void CloseContents(content::WebContents* contents) OVERRIDE { |
| 134 prerender_contents_->Destroy(FINAL_STATUS_CLOSED); | 134 prerender_contents_->Destroy(FINAL_STATUS_CLOSED); |
| 135 } | 135 } |
| 136 | 136 |
| 137 virtual void CanDownload( | 137 virtual void CanDownload( |
| 138 RenderViewHost* render_view_host, | 138 RenderViewHost* render_view_host, |
| 139 int request_id, | 139 const GURL& url, |
| 140 const std::string& request_method, | 140 const std::string& request_method, |
| 141 const base::Callback<void(bool)>& callback) OVERRIDE { | 141 const base::Callback<void(bool)>& callback) OVERRIDE { |
| 142 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); | 142 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); |
| 143 // Cancel the download. | 143 // Cancel the download. |
| 144 callback.Run(false); | 144 callback.Run(false); |
| 145 } | 145 } |
| 146 | 146 |
| 147 virtual bool ShouldCreateWebContents( | 147 virtual bool ShouldCreateWebContents( |
| 148 WebContents* web_contents, | 148 WebContents* web_contents, |
| 149 int route_id, | 149 int route_id, |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 void PrerenderContents::AddResourceThrottle( | 899 void PrerenderContents::AddResourceThrottle( |
| 900 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 900 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
| 901 resource_throttles_.push_back(throttle); | 901 resource_throttles_.push_back(throttle); |
| 902 } | 902 } |
| 903 | 903 |
| 904 void PrerenderContents::AddNetworkBytes(int64 bytes) { | 904 void PrerenderContents::AddNetworkBytes(int64 bytes) { |
| 905 network_bytes_ += bytes; | 905 network_bytes_ += bytes; |
| 906 } | 906 } |
| 907 | 907 |
| 908 } // namespace prerender | 908 } // namespace prerender |
| OLD | NEW |