| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 290 } |
| 291 | 291 |
| 292 void NetErrorTabHelper::RunNetworkDiagnosticsHelper( | 292 void NetErrorTabHelper::RunNetworkDiagnosticsHelper( |
| 293 const std::string& sanitized_url) { | 293 const std::string& sanitized_url) { |
| 294 ShowNetworkDiagnosticsDialog(web_contents(), sanitized_url); | 294 ShowNetworkDiagnosticsDialog(web_contents(), sanitized_url); |
| 295 } | 295 } |
| 296 | 296 |
| 297 #if BUILDFLAG(ANDROID_JAVA_UI) | 297 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 298 void NetErrorTabHelper::SetHasOfflinePages( | 298 void NetErrorTabHelper::SetHasOfflinePages( |
| 299 content::RenderFrameHost* render_frame_host) { | 299 content::RenderFrameHost* render_frame_host) { |
| 300 // Bails out if offline pages not supported. | 300 // Bails out if offline bookmarks not supported. |
| 301 if (!offline_pages::IsOfflinePagesEnabled()) | 301 if (!offline_pages::IsOfflineBookmarksEnabled()) |
| 302 return; | 302 return; |
| 303 | 303 |
| 304 offline_pages::OfflinePageModel* offline_page_model = | 304 offline_pages::OfflinePageModel* offline_page_model = |
| 305 offline_pages::OfflinePageModelFactory::GetForBrowserContext( | 305 offline_pages::OfflinePageModelFactory::GetForBrowserContext( |
| 306 web_contents()->GetBrowserContext()); | 306 web_contents()->GetBrowserContext()); |
| 307 if (!offline_page_model) | 307 if (!offline_page_model) |
| 308 return; | 308 return; |
| 309 | 309 |
| 310 render_frame_host->Send(new ChromeViewMsg_SetHasOfflinePages( | 310 render_frame_host->Send(new ChromeViewMsg_SetHasOfflinePages( |
| 311 render_frame_host->GetRoutingID(), | 311 render_frame_host->GetRoutingID(), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 325 | 325 |
| 326 bool NetErrorTabHelper::IsFromErrorPage() const { | 326 bool NetErrorTabHelper::IsFromErrorPage() const { |
| 327 content::NavigationEntry* entry = | 327 content::NavigationEntry* entry = |
| 328 web_contents()->GetController().GetLastCommittedEntry(); | 328 web_contents()->GetController().GetLastCommittedEntry(); |
| 329 return entry && (entry->GetPageType() == content::PAGE_TYPE_ERROR); | 329 return entry && (entry->GetPageType() == content::PAGE_TYPE_ERROR); |
| 330 } | 330 } |
| 331 | 331 |
| 332 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 332 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
| 333 | 333 |
| 334 } // namespace chrome_browser_net | 334 } // namespace chrome_browser_net |
| OLD | NEW |