Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2162 SendAndRunNestedMessageLoop(new FrameHostMsg_RunJavaScriptMessage( | 2162 SendAndRunNestedMessageLoop(new FrameHostMsg_RunJavaScriptMessage( |
| 2163 routing_id_, message, default_value, frame_url, type, &success, result)); | 2163 routing_id_, message, default_value, frame_url, type, &success, result)); |
| 2164 return success; | 2164 return success; |
| 2165 } | 2165 } |
| 2166 | 2166 |
| 2167 void RenderFrameImpl::LoadNavigationErrorPage( | 2167 void RenderFrameImpl::LoadNavigationErrorPage( |
| 2168 const WebURLRequest& failed_request, | 2168 const WebURLRequest& failed_request, |
| 2169 const WebURLError& error, | 2169 const WebURLError& error, |
| 2170 bool replace) { | 2170 bool replace) { |
| 2171 std::string error_html; | 2171 std::string error_html; |
| 2172 GetContentClient()->renderer()->GetNavigationErrorStrings( | 2172 |
| 2173 this, failed_request, error, &error_html, nullptr); | 2173 if (!RenderThreadImpl::current() || |
| 2174 !RenderThreadImpl::current()->layout_test_mode()) { | |
|
Mike West
2016/04/25 13:06:21
It's super-strange that we're checking whether we'
| |
| 2175 GetContentClient()->renderer()->GetNavigationErrorStrings( | |
| 2176 this, failed_request, error, &error_html, nullptr); | |
| 2177 } | |
| 2174 | 2178 |
| 2175 frame_->loadHTMLString(error_html, | 2179 frame_->loadHTMLString(error_html, |
| 2176 GURL(kUnreachableWebDataURL), | 2180 GURL(kUnreachableWebDataURL), |
| 2177 error.unreachableURL, | 2181 error.unreachableURL, |
| 2178 replace); | 2182 replace); |
| 2179 } | 2183 } |
| 2180 | 2184 |
| 2181 void RenderFrameImpl::DidMeaningfulLayout( | 2185 void RenderFrameImpl::DidMeaningfulLayout( |
| 2182 blink::WebMeaningfulLayout layout_type) { | 2186 blink::WebMeaningfulLayout layout_type) { |
| 2183 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, | 2187 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, |
| (...skipping 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5755 render_view_->renderer_preferences_.disable_client_blocked_error_page) { | 5759 render_view_->renderer_preferences_.disable_client_blocked_error_page) { |
| 5756 return false; | 5760 return false; |
| 5757 } | 5761 } |
| 5758 | 5762 |
| 5759 // Allow the embedder to suppress an error page. | 5763 // Allow the embedder to suppress an error page. |
| 5760 if (GetContentClient()->renderer()->ShouldSuppressErrorPage( | 5764 if (GetContentClient()->renderer()->ShouldSuppressErrorPage( |
| 5761 this, unreachable_url)) { | 5765 this, unreachable_url)) { |
| 5762 return false; | 5766 return false; |
| 5763 } | 5767 } |
| 5764 | 5768 |
| 5765 if (RenderThreadImpl::current() && | |
| 5766 RenderThreadImpl::current()->layout_test_mode()) { | |
| 5767 return false; | |
|
Mike West
2016/04/25 13:06:21
Returning false here for layout tests means that b
| |
| 5768 } | |
| 5769 | |
| 5770 return true; | 5769 return true; |
| 5771 } | 5770 } |
| 5772 | 5771 |
| 5773 GURL RenderFrameImpl::GetLoadingUrl() const { | 5772 GURL RenderFrameImpl::GetLoadingUrl() const { |
| 5774 WebDataSource* ds = frame_->dataSource(); | 5773 WebDataSource* ds = frame_->dataSource(); |
| 5775 | 5774 |
| 5776 GURL overriden_url; | 5775 GURL overriden_url; |
| 5777 if (MaybeGetOverriddenURL(ds, &overriden_url)) | 5776 if (MaybeGetOverriddenURL(ds, &overriden_url)) |
| 5778 return overriden_url; | 5777 return overriden_url; |
| 5779 | 5778 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6031 int match_count, | 6030 int match_count, |
| 6032 int ordinal, | 6031 int ordinal, |
| 6033 const WebRect& selection_rect, | 6032 const WebRect& selection_rect, |
| 6034 bool final_status_update) { | 6033 bool final_status_update) { |
| 6035 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6034 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6036 selection_rect, ordinal, | 6035 selection_rect, ordinal, |
| 6037 final_status_update)); | 6036 final_status_update)); |
| 6038 } | 6037 } |
| 6039 | 6038 |
| 6040 } // namespace content | 6039 } // namespace content |
| OLD | NEW |