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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 render_frame_host->GetRemoteAssociatedInterfaces()->GetInterface(&client); | 95 render_frame_host->GetRemoteAssociatedInterfaces()->GetInterface(&client); |
96 client->SetCanShowNetworkDiagnosticsDialog(CanShowNetworkDiagnosticsDialog()); | 96 client->SetCanShowNetworkDiagnosticsDialog(CanShowNetworkDiagnosticsDialog()); |
97 } | 97 } |
98 | 98 |
99 void NetErrorTabHelper::DidStartNavigation( | 99 void NetErrorTabHelper::DidStartNavigation( |
100 content::NavigationHandle* navigation_handle) { | 100 content::NavigationHandle* navigation_handle) { |
101 if (!navigation_handle->IsInMainFrame()) | 101 if (!navigation_handle->IsInMainFrame()) |
102 return; | 102 return; |
103 | 103 |
104 if (navigation_handle->IsErrorPage() && | 104 if (navigation_handle->IsErrorPage() && |
105 navigation_handle->GetPageTransition() == ui::PAGE_TRANSITION_RELOAD) { | 105 PageTransitionCoreTypeIs(navigation_handle->GetPageTransition(), |
| 106 ui::PAGE_TRANSITION_RELOAD)) { |
106 error_page::RecordEvent( | 107 error_page::RecordEvent( |
107 error_page::NETWORK_ERROR_PAGE_BROWSER_INITIATED_RELOAD); | 108 error_page::NETWORK_ERROR_PAGE_BROWSER_INITIATED_RELOAD); |
108 } | 109 } |
109 } | 110 } |
110 | 111 |
111 void NetErrorTabHelper::DidFinishNavigation( | 112 void NetErrorTabHelper::DidFinishNavigation( |
112 content::NavigationHandle* navigation_handle) { | 113 content::NavigationHandle* navigation_handle) { |
113 if (!navigation_handle->IsInMainFrame()) | 114 if (!navigation_handle->IsInMainFrame()) |
114 return; | 115 return; |
115 | 116 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 offline_pages::ClientId client_id( | 286 offline_pages::ClientId client_id( |
286 offline_pages::kAsyncNamespace, base::GenerateGUID()); | 287 offline_pages::kAsyncNamespace, base::GenerateGUID()); |
287 request_coordinator->SavePageLater( | 288 request_coordinator->SavePageLater( |
288 page_url, client_id, true /*user_requested*/, | 289 page_url, client_id, true /*user_requested*/, |
289 offline_pages::RequestCoordinator::RequestAvailability:: | 290 offline_pages::RequestCoordinator::RequestAvailability:: |
290 ENABLED_FOR_OFFLINER); | 291 ENABLED_FOR_OFFLINER); |
291 } | 292 } |
292 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 293 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
293 | 294 |
294 } // namespace chrome_browser_net | 295 } // namespace chrome_browser_net |
OLD | NEW |