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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 856643002: Viewing cached webpages while offline is not available on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index 93f0cf67ad69404233d06d06891811b32e571df3..ebddfcd6cb4684d64d41796502bada351df42957 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/signin/signin_header_helper.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/login/login_prompt.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -362,7 +363,11 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
#if defined(OS_CHROMEOS)
// Check if we need to add offline throttle. This should be done only
// for main frames.
- if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) {
+ // We will fall back to the old ChromeOS offline error page if the
+ // --disable-new-offline-error-page command-line switch is defined.
+ bool new_error_page_enabled = switches::NewOfflineErrorPageEnabled();
+ if (!new_error_page_enabled &&
+ resource_type == content::RESOURCE_TYPE_MAIN_FRAME) {
// We check offline first, then check safe browsing so that we still can
// block unsafe site after we remove offline page.
throttles->push_back(new OfflineResourceThrottle(request,
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698