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

Side by Side Diff: chrome/browser/renderer_host/offline_resource_throttle.cc

Issue 23658056: content: Move kHttpScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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/renderer_host/offline_resource_throttle.h" 5 #include "chrome/browser/renderer_host/offline_resource_throttle.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 if (proceed) { 109 if (proceed) {
110 controller()->Resume(); 110 controller()->Resume();
111 } else { 111 } else {
112 controller()->Cancel(); 112 controller()->Cancel();
113 } 113 }
114 } 114 }
115 115
116 bool OfflineResourceThrottle::IsRemote(const GURL& url) const { 116 bool OfflineResourceThrottle::IsRemote(const GURL& url) const {
117 return !net::IsLocalhost(url.host()) && (url.SchemeIs(chrome::kFtpScheme) || 117 return !net::IsLocalhost(url.host()) && (url.SchemeIs(chrome::kFtpScheme) ||
118 url.SchemeIs(chrome::kHttpScheme) || 118 url.SchemeIs(content::kHttpScheme) ||
119 url.SchemeIs(content::kHttpsScheme)); 119 url.SchemeIs(content::kHttpsScheme));
120 } 120 }
121 121
122 bool OfflineResourceThrottle::ShouldShowOfflinePage(const GURL& url) const { 122 bool OfflineResourceThrottle::ShouldShowOfflinePage(const GURL& url) const {
123 // If the network is disconnected while loading other resources, we'll simply 123 // If the network is disconnected while loading other resources, we'll simply
124 // show broken link/images. 124 // show broken link/images.
125 return IsRemote(url) && net::NetworkChangeNotifier::IsOffline(); 125 return IsRemote(url) && net::NetworkChangeNotifier::IsOffline();
126 } 126 }
127 127
128 void OfflineResourceThrottle::OnCanHandleOfflineComplete(int rv) { 128 void OfflineResourceThrottle::OnCanHandleOfflineComplete(int rv) {
(...skipping 10 matching lines...) Expand all
139 base::Bind( 139 base::Bind(
140 &ShowOfflinePage, 140 &ShowOfflinePage,
141 info->GetChildID(), 141 info->GetChildID(),
142 info->GetRouteID(), 142 info->GetRouteID(),
143 request_->url(), 143 request_->url(),
144 base::Bind( 144 base::Bind(
145 &OfflineResourceThrottle::OnBlockingPageComplete, 145 &OfflineResourceThrottle::OnBlockingPageComplete,
146 AsWeakPtr()))); 146 AsWeakPtr())));
147 } 147 }
148 } 148 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/chrome_render_view_host_observer.cc ('k') | chrome/browser/safe_browsing/database_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698