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/custom_handlers/protocol_handler_registry.h" | 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledURL( | 200 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledURL( |
201 const GURL& url) const { | 201 const GURL& url) const { |
202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
203 return (url.is_valid() && | 203 return (url.is_valid() && |
204 io_thread_delegate_->IsHandledProtocol(url.scheme())) || | 204 io_thread_delegate_->IsHandledProtocol(url.scheme())) || |
205 job_factory_->IsHandledURL(url); | 205 job_factory_->IsHandledURL(url); |
206 } | 206 } |
207 | 207 |
| 208 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsSafeRedirectTarget( |
| 209 const GURL& location) const { |
| 210 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 211 return job_factory_->IsSafeRedirectTarget(location); |
| 212 } |
| 213 |
208 // DefaultClientObserver ------------------------------------------------------ | 214 // DefaultClientObserver ------------------------------------------------------ |
209 | 215 |
210 ProtocolHandlerRegistry::DefaultClientObserver::DefaultClientObserver( | 216 ProtocolHandlerRegistry::DefaultClientObserver::DefaultClientObserver( |
211 ProtocolHandlerRegistry* registry) | 217 ProtocolHandlerRegistry* registry) |
212 : worker_(NULL), | 218 : worker_(NULL), |
213 registry_(registry) { | 219 registry_(registry) { |
214 DCHECK(registry_); | 220 DCHECK(registry_); |
215 } | 221 } |
216 | 222 |
217 ProtocolHandlerRegistry::DefaultClientObserver::~DefaultClientObserver() { | 223 ProtocolHandlerRegistry::DefaultClientObserver::~DefaultClientObserver() { |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 | 878 |
873 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 879 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
874 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { | 880 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { |
875 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 881 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
876 // this is always created on the UI thread (in profile_io's | 882 // this is always created on the UI thread (in profile_io's |
877 // InitializeOnUIThread. Any method calls must be done | 883 // InitializeOnUIThread. Any method calls must be done |
878 // on the IO thread (this is checked). | 884 // on the IO thread (this is checked). |
879 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( | 885 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( |
880 io_thread_delegate_)); | 886 io_thread_delegate_)); |
881 } | 887 } |
OLD | NEW |