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

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

Issue 23112033: content: Move kHttpsScheme 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
111 111
112 if (proceed) { 112 if (proceed) {
113 controller()->Resume(); 113 controller()->Resume();
114 } else { 114 } else {
115 controller()->Cancel(); 115 controller()->Cancel();
116 } 116 }
117 } 117 }
118 118
119 bool OfflineResourceThrottle::IsRemote(const GURL& url) const { 119 bool OfflineResourceThrottle::IsRemote(const GURL& url) const {
120 return !net::IsLocalhost(url.host()) && 120 return !net::IsLocalhost(url.host()) && (url.SchemeIs(chrome::kFtpScheme) ||
121 (url.SchemeIs(chrome::kFtpScheme) || 121 url.SchemeIs(chrome::kHttpScheme) ||
122 url.SchemeIs(chrome::kHttpScheme) || 122 url.SchemeIs(content::kHttpsScheme));
123 url.SchemeIs(chrome::kHttpsScheme));
124 } 123 }
125 124
126 bool OfflineResourceThrottle::ShouldShowOfflinePage(const GURL& url) const { 125 bool OfflineResourceThrottle::ShouldShowOfflinePage(const GURL& url) const {
127 // If the network is disconnected while loading other resources, we'll simply 126 // If the network is disconnected while loading other resources, we'll simply
128 // show broken link/images. 127 // show broken link/images.
129 return IsRemote(url) && net::NetworkChangeNotifier::IsOffline(); 128 return IsRemote(url) && net::NetworkChangeNotifier::IsOffline();
130 } 129 }
131 130
132 void OfflineResourceThrottle::OnCanHandleOfflineComplete(int rv) { 131 void OfflineResourceThrottle::OnCanHandleOfflineComplete(int rv) {
133 appcache_completion_callback_.Cancel(); 132 appcache_completion_callback_.Cancel();
134 133
135 if (rv == net::OK) { 134 if (rv == net::OK) {
136 controller()->Resume(); 135 controller()->Resume();
137 } else { 136 } else {
138 BrowserThread::PostTask( 137 BrowserThread::PostTask(
139 BrowserThread::UI, 138 BrowserThread::UI,
140 FROM_HERE, 139 FROM_HERE,
141 base::Bind( 140 base::Bind(
142 &ShowOfflinePage, 141 &ShowOfflinePage,
143 render_process_id_, 142 render_process_id_,
144 render_view_id_, 143 render_view_id_,
145 request_->url(), 144 request_->url(),
146 base::Bind( 145 base::Bind(
147 &OfflineResourceThrottle::OnBlockingPageComplete, 146 &OfflineResourceThrottle::OnBlockingPageComplete,
148 AsWeakPtr()))); 147 AsWeakPtr())));
149 } 148 }
150 } 149 }
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