| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 289 |
| 290 ShowNetworkDiagnosticsDialog(web_contents(), sanitized_url); | 290 ShowNetworkDiagnosticsDialog(web_contents(), sanitized_url); |
| 291 } | 291 } |
| 292 | 292 |
| 293 #if defined(OS_ANDROID) | 293 #if defined(OS_ANDROID) |
| 294 void NetErrorTabHelper::DownloadPageLaterHelper(const GURL& page_url) { | 294 void NetErrorTabHelper::DownloadPageLaterHelper(const GURL& page_url) { |
| 295 offline_pages::RequestCoordinator* request_coordinator = | 295 offline_pages::RequestCoordinator* request_coordinator = |
| 296 offline_pages::RequestCoordinatorFactory::GetForBrowserContext( | 296 offline_pages::RequestCoordinatorFactory::GetForBrowserContext( |
| 297 web_contents()->GetBrowserContext()); | 297 web_contents()->GetBrowserContext()); |
| 298 DCHECK(request_coordinator) << "No RequestCoordinator for SavePageLater"; | 298 DCHECK(request_coordinator) << "No RequestCoordinator for SavePageLater"; |
| 299 offline_pages::ClientId client_id( | 299 offline_pages::RequestCoordinator::SavePageLaterParams params; |
| 300 offline_pages::kAsyncNamespace, base::GenerateGUID()); | 300 params.url = page_url; |
| 301 request_coordinator->SavePageLater( | 301 params.client_id = offline_pages::ClientId(offline_pages::kAsyncNamespace, |
| 302 page_url, client_id, true /*user_requested*/, | 302 base::GenerateGUID()); |
| 303 offline_pages::RequestCoordinator::RequestAvailability:: | 303 request_coordinator->SavePageLater(params); |
| 304 ENABLED_FOR_OFFLINER); | |
| 305 } | 304 } |
| 306 #endif // defined(OS_ANDROID) | 305 #endif // defined(OS_ANDROID) |
| 307 | 306 |
| 308 } // namespace chrome_browser_net | 307 } // namespace chrome_browser_net |
| OLD | NEW |