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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 // we didn't free them they could respond to workers and try to update the | 700 // we didn't free them they could respond to workers and try to update the |
701 // protocol handler registry after it was deleted. | 701 // protocol handler registry after it was deleted. |
702 // Observers remove themselves from this list when they are deleted; so | 702 // Observers remove themselves from this list when they are deleted; so |
703 // we delete the last item until none are left in the list. | 703 // we delete the last item until none are left in the list. |
704 while (!default_client_observers_.empty()) { | 704 while (!default_client_observers_.empty()) { |
705 delete default_client_observers_.back(); | 705 delete default_client_observers_.back(); |
706 } | 706 } |
707 } | 707 } |
708 | 708 |
709 // static | 709 // static |
710 void ProtocolHandlerRegistry::RegisterUserPrefs( | 710 void ProtocolHandlerRegistry::RegisterProfilePrefs( |
711 user_prefs::PrefRegistrySyncable* registry) { | 711 user_prefs::PrefRegistrySyncable* registry) { |
712 registry->RegisterListPref(prefs::kRegisteredProtocolHandlers, | 712 registry->RegisterListPref(prefs::kRegisteredProtocolHandlers, |
713 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 713 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
714 registry->RegisterListPref(prefs::kIgnoredProtocolHandlers, | 714 registry->RegisterListPref(prefs::kIgnoredProtocolHandlers, |
715 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 715 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
716 registry->RegisterBooleanPref( | 716 registry->RegisterBooleanPref( |
717 prefs::kCustomHandlersEnabled, | 717 prefs::kCustomHandlersEnabled, |
718 true, | 718 true, |
719 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 719 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
720 } | 720 } |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 | 878 |
879 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 879 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
880 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { | 880 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { |
881 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 881 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
882 // 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 |
883 // InitializeOnUIThread. Any method calls must be done | 883 // InitializeOnUIThread. Any method calls must be done |
884 // on the IO thread (this is checked). | 884 // on the IO thread (this is checked). |
885 return scoped_ptr<JobInterceptorFactory>( | 885 return scoped_ptr<JobInterceptorFactory>( |
886 new JobInterceptorFactory(io_thread_delegate_.get())); | 886 new JobInterceptorFactory(io_thread_delegate_.get())); |
887 } | 887 } |
OLD | NEW |