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

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

Issue 691823002: Add WebContents source to methods in WebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 bool OnGoToEntryOffset(int offset) override { 165 bool OnGoToEntryOffset(int offset) override {
166 // This isn't allowed because the history merge operation 166 // This isn't allowed because the history merge operation
167 // does not work if there are renderer issued challenges. 167 // does not work if there are renderer issued challenges.
168 // TODO(cbentzel): Cancel in this case? May not need to do 168 // TODO(cbentzel): Cancel in this case? May not need to do
169 // since render-issued offset navigations are not guaranteed, 169 // since render-issued offset navigations are not guaranteed,
170 // but indicates that the page cares about the history. 170 // but indicates that the page cares about the history.
171 return false; 171 return false;
172 } 172 }
173 173
174 bool ShouldSuppressDialogs() override { 174 bool ShouldSuppressDialogs(WebContents* source) override {
175 // We still want to show the user the message when they navigate to this 175 // We still want to show the user the message when they navigate to this
176 // page, so cancel this prerender. 176 // page, so cancel this prerender.
177 prerender_contents_->Destroy(FINAL_STATUS_JAVASCRIPT_ALERT); 177 prerender_contents_->Destroy(FINAL_STATUS_JAVASCRIPT_ALERT);
178 // Always suppress JavaScript messages if they're triggered by a page being 178 // Always suppress JavaScript messages if they're triggered by a page being
179 // prerendered. 179 // prerendered.
180 return true; 180 return true;
181 } 181 }
182 182
183 void RegisterProtocolHandler(WebContents* web_contents, 183 void RegisterProtocolHandler(WebContents* web_contents,
184 const std::string& protocol, 184 const std::string& protocol,
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 void PrerenderContents::AddResourceThrottle( 887 void PrerenderContents::AddResourceThrottle(
888 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { 888 const base::WeakPtr<PrerenderResourceThrottle>& throttle) {
889 resource_throttles_.push_back(throttle); 889 resource_throttles_.push_back(throttle);
890 } 890 }
891 891
892 void PrerenderContents::AddNetworkBytes(int64 bytes) { 892 void PrerenderContents::AddNetworkBytes(int64 bytes) {
893 network_bytes_ += bytes; 893 network_bytes_ += bytes;
894 } 894 }
895 895
896 } // namespace prerender 896 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698