OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/renderer/net/net_error_helper.h" | 5 #include "chrome/renderer/net/net_error_helper.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 GetRemoteNetworkDiagnostics()->RunNetworkDiagnostics(page_url); | 333 GetRemoteNetworkDiagnostics()->RunNetworkDiagnostics(page_url); |
334 } | 334 } |
335 | 335 |
336 void NetErrorHelper::DownloadPageLater() { | 336 void NetErrorHelper::DownloadPageLater() { |
337 #if defined(OS_ANDROID) | 337 #if defined(OS_ANDROID) |
338 render_frame()->Send(new ChromeViewHostMsg_DownloadPageLater( | 338 render_frame()->Send(new ChromeViewHostMsg_DownloadPageLater( |
339 render_frame()->GetRoutingID())); | 339 render_frame()->GetRoutingID())); |
340 #endif // defined(OS_ANDROID) | 340 #endif // defined(OS_ANDROID) |
341 } | 341 } |
342 | 342 |
| 343 void NetErrorHelper::SetIsShowingDownloadButton(bool show) { |
| 344 #if defined(OS_ANDROID) |
| 345 render_frame()->Send( |
| 346 new ChromeViewHostMsg_SetIsShowingDownloadButtonInErrorPage( |
| 347 render_frame()->GetRoutingID(), show)); |
| 348 #endif // defined(OS_ANDROID) |
| 349 } |
| 350 |
343 void NetErrorHelper::OnNetErrorInfo(int status_num) { | 351 void NetErrorHelper::OnNetErrorInfo(int status_num) { |
344 DCHECK(status_num >= 0 && status_num < error_page::DNS_PROBE_MAX); | 352 DCHECK(status_num >= 0 && status_num < error_page::DNS_PROBE_MAX); |
345 | 353 |
346 DVLOG(1) << "Received status " << DnsProbeStatusToString(status_num); | 354 DVLOG(1) << "Received status " << DnsProbeStatusToString(status_num); |
347 | 355 |
348 core_->OnNetErrorInfo(static_cast<DnsProbeStatus>(status_num)); | 356 core_->OnNetErrorInfo(static_cast<DnsProbeStatus>(status_num)); |
349 } | 357 } |
350 | 358 |
351 void NetErrorHelper::OnSetNavigationCorrectionInfo( | 359 void NetErrorHelper::OnSetNavigationCorrectionInfo( |
352 const GURL& navigation_correction_url, | 360 const GURL& navigation_correction_url, |
(...skipping 25 matching lines...) Expand all Loading... |
378 | 386 |
379 void NetErrorHelper::OnNetworkDiagnosticsClientRequest( | 387 void NetErrorHelper::OnNetworkDiagnosticsClientRequest( |
380 chrome::mojom::NetworkDiagnosticsClientAssociatedRequest request) { | 388 chrome::mojom::NetworkDiagnosticsClientAssociatedRequest request) { |
381 DCHECK(!network_diagnostics_client_binding_.is_bound()); | 389 DCHECK(!network_diagnostics_client_binding_.is_bound()); |
382 network_diagnostics_client_binding_.Bind(std::move(request)); | 390 network_diagnostics_client_binding_.Bind(std::move(request)); |
383 } | 391 } |
384 | 392 |
385 void NetErrorHelper::SetCanShowNetworkDiagnosticsDialog(bool can_show) { | 393 void NetErrorHelper::SetCanShowNetworkDiagnosticsDialog(bool can_show) { |
386 core_->OnSetCanShowNetworkDiagnosticsDialog(can_show); | 394 core_->OnSetCanShowNetworkDiagnosticsDialog(can_show); |
387 } | 395 } |
OLD | NEW |