OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/managed_mode/managed_user_service.h" | 5 #include "chrome/browser/managed_mode/managed_user_service.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // static | 101 // static |
102 void ManagedUserService::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 102 void ManagedUserService::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
103 registry->RegisterDictionaryPref(prefs::kManagedModeManualHosts, | 103 registry->RegisterDictionaryPref(prefs::kManagedModeManualHosts, |
104 PrefRegistrySyncable::UNSYNCABLE_PREF); | 104 PrefRegistrySyncable::UNSYNCABLE_PREF); |
105 registry->RegisterDictionaryPref(prefs::kManagedModeManualURLs, | 105 registry->RegisterDictionaryPref(prefs::kManagedModeManualURLs, |
106 PrefRegistrySyncable::UNSYNCABLE_PREF); | 106 PrefRegistrySyncable::UNSYNCABLE_PREF); |
107 registry->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, | 107 registry->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, |
108 ManagedModeURLFilter::BLOCK, | 108 ManagedModeURLFilter::BLOCK, |
109 PrefRegistrySyncable::UNSYNCABLE_PREF); | 109 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 110 registry->RegisterStringPref(prefs::kManagedModeLocalPassphrase, |
| 111 "", |
| 112 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 113 registry->RegisterStringPref(prefs::kManagedModeLocalSalt, |
| 114 "", |
| 115 PrefRegistrySyncable::UNSYNCABLE_PREF); |
110 } | 116 } |
111 | 117 |
112 scoped_refptr<const ManagedModeURLFilter> | 118 scoped_refptr<const ManagedModeURLFilter> |
113 ManagedUserService::GetURLFilterForIOThread() { | 119 ManagedUserService::GetURLFilterForIOThread() { |
114 return url_filter_context_.io_url_filter(); | 120 return url_filter_context_.io_url_filter(); |
115 } | 121 } |
116 | 122 |
117 ManagedModeURLFilter* ManagedUserService::GetURLFilterForUIThread() { | 123 ManagedModeURLFilter* ManagedUserService::GetURLFilterForUIThread() { |
118 return url_filter_context_.ui_url_filter(); | 124 return url_filter_context_.ui_url_filter(); |
119 } | 125 } |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); | 366 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); |
361 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); | 367 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); |
362 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { | 368 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { |
363 bool allow = false; | 369 bool allow = false; |
364 bool result = it.value().GetAsBoolean(&allow); | 370 bool result = it.value().GetAsBoolean(&allow); |
365 DCHECK(result); | 371 DCHECK(result); |
366 (*url_map)[GURL(it.key())] = allow; | 372 (*url_map)[GURL(it.key())] = allow; |
367 } | 373 } |
368 url_filter_context_.SetManualURLs(url_map.Pass()); | 374 url_filter_context_.SetManualURLs(url_map.Pass()); |
369 } | 375 } |
OLD | NEW |