| 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" |
| 11 #include "chrome/browser/extensions/extension_system.h" | 11 #include "chrome/browser/extensions/extension_system.h" |
| 12 #include "chrome/browser/managed_mode/managed_mode_site_list.h" | 12 #include "chrome/browser/managed_mode/managed_mode_site_list.h" |
| 13 #include "chrome/browser/prefs/pref_registry_syncable.h" | |
| 14 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 13 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
| 17 #include "chrome/common/extensions/extension_set.h" | 16 #include "chrome/common/extensions/extension_set.h" |
| 18 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "components/user_prefs/pref_registry_syncable.h" |
| 19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 | 22 |
| 23 using content::BrowserThread; | 23 using content::BrowserThread; |
| 24 | 24 |
| 25 ManagedUserService::URLFilterContext::URLFilterContext() | 25 ManagedUserService::URLFilterContext::URLFilterContext() |
| 26 : ui_url_filter_(new ManagedModeURLFilter), | 26 : ui_url_filter_(new ManagedModeURLFilter), |
| 27 io_url_filter_(new ManagedModeURLFilter) {} | 27 io_url_filter_(new ManagedModeURLFilter) {} |
| 28 ManagedUserService::URLFilterContext::~URLFilterContext() {} | 28 ManagedUserService::URLFilterContext::~URLFilterContext() {} |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); | 391 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); |
| 392 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); | 392 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); |
| 393 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { | 393 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { |
| 394 bool allow = false; | 394 bool allow = false; |
| 395 bool result = it.value().GetAsBoolean(&allow); | 395 bool result = it.value().GetAsBoolean(&allow); |
| 396 DCHECK(result); | 396 DCHECK(result); |
| 397 (*url_map)[GURL(it.key())] = allow; | 397 (*url_map)[GURL(it.key())] = allow; |
| 398 } | 398 } |
| 399 url_filter_context_.SetManualURLs(url_map.Pass()); | 399 url_filter_context_.SetManualURLs(url_map.Pass()); |
| 400 } | 400 } |
| OLD | NEW |