| 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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 827 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 828 std::vector<const DictionaryValue*> result; | 828 std::vector<const DictionaryValue*> result; |
| 829 PrefService* prefs = profile_->GetPrefs(); | 829 PrefService* prefs = profile_->GetPrefs(); |
| 830 if (!prefs->HasPrefPath(pref_name)) { | 830 if (!prefs->HasPrefPath(pref_name)) { |
| 831 return result; | 831 return result; |
| 832 } | 832 } |
| 833 | 833 |
| 834 const ListValue* handlers = prefs->GetList(pref_name); | 834 const ListValue* handlers = prefs->GetList(pref_name); |
| 835 if (handlers) { | 835 if (handlers) { |
| 836 for (size_t i = 0; i < handlers->GetSize(); ++i) { | 836 for (size_t i = 0; i < handlers->GetSize(); ++i) { |
| 837 DictionaryValue* dict; | 837 const DictionaryValue* dict; |
| 838 if (!handlers->GetDictionary(i, &dict)) | 838 if (!handlers->GetDictionary(i, &dict)) |
| 839 continue; | 839 continue; |
| 840 if (ProtocolHandler::IsValidDict(dict)) { | 840 if (ProtocolHandler::IsValidDict(dict)) { |
| 841 result.push_back(dict); | 841 result.push_back(dict); |
| 842 } | 842 } |
| 843 } | 843 } |
| 844 } | 844 } |
| 845 return result; | 845 return result; |
| 846 } | 846 } |
| 847 | 847 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 859 } | 859 } |
| 860 | 860 |
| 861 net::URLRequestJobFactory::Interceptor* | 861 net::URLRequestJobFactory::Interceptor* |
| 862 ProtocolHandlerRegistry::CreateURLInterceptor() { | 862 ProtocolHandlerRegistry::CreateURLInterceptor() { |
| 863 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 863 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 864 // this is always created on the UI thread (in profile_io's | 864 // this is always created on the UI thread (in profile_io's |
| 865 // InitializeOnUIThread. Any method calls must be done | 865 // InitializeOnUIThread. Any method calls must be done |
| 866 // on the IO thread (this is checked). | 866 // on the IO thread (this is checked). |
| 867 return new URLInterceptor(core_); | 867 return new URLInterceptor(core_); |
| 868 } | 868 } |
| OLD | NEW |