| 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/net/net_error_tab_helper.h" | 5 #include "chrome/browser/net/net_error_tab_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/io_thread.h" | 10 #include "chrome/browser/io_thread.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 if (render_frame_host->GetParent()) | 99 if (render_frame_host->GetParent()) |
| 100 return; | 100 return; |
| 101 render_frame_host->Send( | 101 render_frame_host->Send( |
| 102 new ChromeViewMsg_SetCanShowNetworkDiagnosticsDialog( | 102 new ChromeViewMsg_SetCanShowNetworkDiagnosticsDialog( |
| 103 render_frame_host->GetRoutingID(), | 103 render_frame_host->GetRoutingID(), |
| 104 CanShowNetworkDiagnosticsDialog())); | 104 CanShowNetworkDiagnosticsDialog())); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void NetErrorTabHelper::DidStartNavigationToPendingEntry( | 107 void NetErrorTabHelper::DidStartNavigationToPendingEntry( |
| 108 const GURL& url, | 108 const GURL& url, |
| 109 content::NavigationController::ReloadType reload_type) { | 109 content::ReloadType reload_type) { |
| 110 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 110 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 111 | 111 |
| 112 if (!is_error_page_) | 112 if (!is_error_page_) |
| 113 return; | 113 return; |
| 114 | 114 |
| 115 // Only record reloads. | 115 // Only record reloads. |
| 116 if (reload_type != content::NavigationController::NO_RELOAD) { | 116 if (reload_type != content::ReloadType::NONE) { |
| 117 error_page::RecordEvent( | 117 error_page::RecordEvent( |
| 118 error_page::NETWORK_ERROR_PAGE_BROWSER_INITIATED_RELOAD); | 118 error_page::NETWORK_ERROR_PAGE_BROWSER_INITIATED_RELOAD); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 void NetErrorTabHelper::DidStartProvisionalLoadForFrame( | 122 void NetErrorTabHelper::DidStartProvisionalLoadForFrame( |
| 123 content::RenderFrameHost* render_frame_host, | 123 content::RenderFrameHost* render_frame_host, |
| 124 const GURL& validated_url, | 124 const GURL& validated_url, |
| 125 bool is_error_page, | 125 bool is_error_page, |
| 126 bool is_iframe_srcdoc) { | 126 bool is_iframe_srcdoc) { |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 bool NetErrorTabHelper::IsFromErrorPage() const { | 327 bool NetErrorTabHelper::IsFromErrorPage() const { |
| 328 content::NavigationEntry* entry = | 328 content::NavigationEntry* entry = |
| 329 web_contents()->GetController().GetLastCommittedEntry(); | 329 web_contents()->GetController().GetLastCommittedEntry(); |
| 330 return entry && (entry->GetPageType() == content::PAGE_TYPE_ERROR); | 330 return entry && (entry->GetPageType() == content::PAGE_TYPE_ERROR); |
| 331 } | 331 } |
| 332 | 332 |
| 333 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 333 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
| 334 | 334 |
| 335 } // namespace chrome_browser_net | 335 } // namespace chrome_browser_net |
| OLD | NEW |