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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } else { | 235 } else { |
236 NOTREACHED(); | 236 NOTREACHED(); |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 void ProtocolHandlerRegistry::DefaultClientObserver::SetWorker( | 240 void ProtocolHandlerRegistry::DefaultClientObserver::SetWorker( |
241 ShellIntegration::DefaultProtocolClientWorker* worker) { | 241 ShellIntegration::DefaultProtocolClientWorker* worker) { |
242 worker_ = worker; | 242 worker_ = worker; |
243 } | 243 } |
244 | 244 |
| 245 bool ProtocolHandlerRegistry::DefaultClientObserver::IsOwnedByWorker() { |
| 246 return true; |
| 247 } |
| 248 |
245 // Delegate -------------------------------------------------------------------- | 249 // Delegate -------------------------------------------------------------------- |
246 | 250 |
247 ProtocolHandlerRegistry::Delegate::~Delegate() {} | 251 ProtocolHandlerRegistry::Delegate::~Delegate() {} |
248 | 252 |
249 void ProtocolHandlerRegistry::Delegate::RegisterExternalHandler( | 253 void ProtocolHandlerRegistry::Delegate::RegisterExternalHandler( |
250 const std::string& protocol) { | 254 const std::string& protocol) { |
251 ChildProcessSecurityPolicy* policy = | 255 ChildProcessSecurityPolicy* policy = |
252 ChildProcessSecurityPolicy::GetInstance(); | 256 ChildProcessSecurityPolicy::GetInstance(); |
253 if (!policy->IsWebSafeScheme(protocol)) { | 257 if (!policy->IsWebSafeScheme(protocol)) { |
254 policy->RegisterWebSafeScheme(protocol); | 258 policy->RegisterWebSafeScheme(protocol); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 } | 863 } |
860 | 864 |
861 net::URLRequestJobFactory::Interceptor* | 865 net::URLRequestJobFactory::Interceptor* |
862 ProtocolHandlerRegistry::CreateURLInterceptor() { | 866 ProtocolHandlerRegistry::CreateURLInterceptor() { |
863 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 867 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
864 // this is always created on the UI thread (in profile_io's | 868 // this is always created on the UI thread (in profile_io's |
865 // InitializeOnUIThread. Any method calls must be done | 869 // InitializeOnUIThread. Any method calls must be done |
866 // on the IO thread (this is checked). | 870 // on the IO thread (this is checked). |
867 return new URLInterceptor(core_); | 871 return new URLInterceptor(core_); |
868 } | 872 } |
OLD | NEW |