| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 PrefRegistrySyncable::UNSYNCABLE_PREF); | 152 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 153 registry->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, | 153 registry->RegisterIntegerPref(prefs::kDefaultManagedModeFilteringBehavior, |
| 154 ManagedModeURLFilter::BLOCK, | 154 ManagedModeURLFilter::BLOCK, |
| 155 PrefRegistrySyncable::UNSYNCABLE_PREF); | 155 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 156 registry->RegisterStringPref(prefs::kManagedModeLocalPassphrase, | 156 registry->RegisterStringPref(prefs::kManagedModeLocalPassphrase, |
| 157 "", | 157 "", |
| 158 PrefRegistrySyncable::UNSYNCABLE_PREF); | 158 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 159 registry->RegisterStringPref(prefs::kManagedModeLocalSalt, | 159 registry->RegisterStringPref(prefs::kManagedModeLocalSalt, |
| 160 "", | 160 "", |
| 161 PrefRegistrySyncable::UNSYNCABLE_PREF); | 161 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 162 registry->RegisterBooleanPref(prefs::kManagedModeHasSeenSetupDialog, |
| 163 false, |
| 164 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 162 } | 165 } |
| 163 | 166 |
| 164 scoped_refptr<const ManagedModeURLFilter> | 167 scoped_refptr<const ManagedModeURLFilter> |
| 165 ManagedUserService::GetURLFilterForIOThread() { | 168 ManagedUserService::GetURLFilterForIOThread() { |
| 166 return url_filter_context_.io_url_filter(); | 169 return url_filter_context_.io_url_filter(); |
| 167 } | 170 } |
| 168 | 171 |
| 169 ManagedModeURLFilter* ManagedUserService::GetURLFilterForUIThread() { | 172 ManagedModeURLFilter* ManagedUserService::GetURLFilterForUIThread() { |
| 170 return url_filter_context_.ui_url_filter(); | 173 return url_filter_context_.ui_url_filter(); |
| 171 } | 174 } |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); | 480 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); |
| 478 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); | 481 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); |
| 479 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { | 482 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { |
| 480 bool allow = false; | 483 bool allow = false; |
| 481 bool result = it.value().GetAsBoolean(&allow); | 484 bool result = it.value().GetAsBoolean(&allow); |
| 482 DCHECK(result); | 485 DCHECK(result); |
| 483 (*url_map)[GURL(it.key())] = allow; | 486 (*url_map)[GURL(it.key())] = allow; |
| 484 } | 487 } |
| 485 url_filter_context_.SetManualURLs(url_map.Pass()); | 488 url_filter_context_.SetManualURLs(url_map.Pass()); |
| 486 } | 489 } |
| OLD | NEW |