| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_view.h" | 5 #include "content/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2627 | 2627 |
| 2628 // Display error page, if appropriate. | 2628 // Display error page, if appropriate. |
| 2629 int http_status_code = navigation_state->http_status_code(); | 2629 int http_status_code = navigation_state->http_status_code(); |
| 2630 if (http_status_code == 404) { | 2630 if (http_status_code == 404) { |
| 2631 // On 404s, try a remote search page as a fallback. | 2631 // On 404s, try a remote search page as a fallback. |
| 2632 const GURL& frame_url = frame->url(); | 2632 const GURL& frame_url = frame->url(); |
| 2633 | 2633 |
| 2634 const GURL& error_page_url = GetAlternateErrorPageURL(frame_url, HTTP_404); | 2634 const GURL& error_page_url = GetAlternateErrorPageURL(frame_url, HTTP_404); |
| 2635 if (error_page_url.is_valid()) { | 2635 if (error_page_url.is_valid()) { |
| 2636 WebURLError original_error; | 2636 WebURLError original_error; |
| 2637 original_error.domain = "http"; |
| 2638 original_error.reason = 404; |
| 2637 original_error.unreachableURL = frame_url; | 2639 original_error.unreachableURL = frame_url; |
| 2638 | 2640 |
| 2639 navigation_state->set_alt_error_page_fetcher( | 2641 navigation_state->set_alt_error_page_fetcher( |
| 2640 new AltErrorPageResourceFetcher( | 2642 new AltErrorPageResourceFetcher( |
| 2641 error_page_url, frame, original_error, | 2643 error_page_url, frame, original_error, |
| 2642 NewCallback(this, &RenderView::AltErrorPageFinished))); | 2644 NewCallback(this, &RenderView::AltErrorPageFinished))); |
| 2643 return; | 2645 return; |
| 2644 } | 2646 } |
| 2645 } | 2647 } |
| 2646 | 2648 |
| (...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4242 const webkit_glue::CustomContextMenuContext& custom_context) { | 4244 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 4243 if (custom_context.is_pepper_menu) | 4245 if (custom_context.is_pepper_menu) |
| 4244 pepper_delegate_.OnContextMenuClosed(custom_context); | 4246 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 4245 else | 4247 else |
| 4246 context_menu_node_.reset(); | 4248 context_menu_node_.reset(); |
| 4247 } | 4249 } |
| 4248 | 4250 |
| 4249 void RenderView::OnNetworkStateChanged(bool online) { | 4251 void RenderView::OnNetworkStateChanged(bool online) { |
| 4250 WebNetworkStateNotifier::setOnLine(online); | 4252 WebNetworkStateNotifier::setOnLine(online); |
| 4251 } | 4253 } |
| OLD | NEW |