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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |