Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1634)

Side by Side Diff: chrome/browser/net/net_error_tab_helper.cc

Issue 1899433002: Update flags used by offline pages and bookmarks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698