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

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

Issue 1303773002: Give the main frame a RenderWidget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void CanDownload(const GURL& url, 107 void CanDownload(const GURL& url,
108 const std::string& request_method, 108 const std::string& request_method,
109 const base::Callback<void(bool)>& callback) override { 109 const base::Callback<void(bool)>& callback) override {
110 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); 110 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD);
111 // Cancel the download. 111 // Cancel the download.
112 callback.Run(false); 112 callback.Run(false);
113 } 113 }
114 114
115 bool ShouldCreateWebContents( 115 bool ShouldCreateWebContents(
116 WebContents* web_contents, 116 WebContents* web_contents,
117 int route_id, 117 int32 route_id,
118 int main_frame_route_id, 118 int32 main_frame_route_id,
119 int32 main_frame_widget_route_id,
119 WindowContainerType window_container_type, 120 WindowContainerType window_container_type,
120 const std::string& frame_name, 121 const std::string& frame_name,
121 const GURL& target_url, 122 const GURL& target_url,
122 const std::string& partition_id, 123 const std::string& partition_id,
123 SessionStorageNamespace* session_storage_namespace) override { 124 SessionStorageNamespace* session_storage_namespace) override {
124 // Since we don't want to permit child windows that would have a 125 // Since we don't want to permit child windows that would have a
125 // window.opener property, terminate prerendering. 126 // window.opener property, terminate prerendering.
126 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); 127 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW);
127 // Cancel the popup. 128 // Cancel the popup.
128 return false; 129 return false;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 void PrerenderContents::AddResourceThrottle( 750 void PrerenderContents::AddResourceThrottle(
750 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { 751 const base::WeakPtr<PrerenderResourceThrottle>& throttle) {
751 resource_throttles_.push_back(throttle); 752 resource_throttles_.push_back(throttle);
752 } 753 }
753 754
754 void PrerenderContents::AddNetworkBytes(int64 bytes) { 755 void PrerenderContents::AddNetworkBytes(int64 bytes) {
755 network_bytes_ += bytes; 756 network_bytes_ += bytes;
756 } 757 }
757 758
758 } // namespace prerender 759 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698