| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 if (!extension_service) | 284 if (!extension_service) |
| 285 return site_lists.Pass(); | 285 return site_lists.Pass(); |
| 286 | 286 |
| 287 const ExtensionSet* extensions = extension_service->extensions(); | 287 const ExtensionSet* extensions = extension_service->extensions(); |
| 288 for (ExtensionSet::const_iterator it = extensions->begin(); | 288 for (ExtensionSet::const_iterator it = extensions->begin(); |
| 289 it != extensions->end(); ++it) { | 289 it != extensions->end(); ++it) { |
| 290 const extensions::Extension* extension = *it; | 290 const extensions::Extension* extension = *it; |
| 291 if (!extension_service->IsExtensionEnabled(extension->id())) | 291 if (!extension_service->IsExtensionEnabled(extension->id())) |
| 292 continue; | 292 continue; |
| 293 | 293 |
| 294 ExtensionResource site_list = extension->GetContentPackSiteList(); | 294 extensions::ExtensionResource site_list = |
| 295 extension->GetContentPackSiteList(); |
| 295 if (!site_list.empty()) | 296 if (!site_list.empty()) |
| 296 site_lists.push_back(new ManagedModeSiteList(extension->id(), site_list)); | 297 site_lists.push_back(new ManagedModeSiteList(extension->id(), site_list)); |
| 297 } | 298 } |
| 298 | 299 |
| 299 return site_lists.Pass(); | 300 return site_lists.Pass(); |
| 300 } | 301 } |
| 301 | 302 |
| 302 void ManagedUserService::OnDefaultFilteringBehaviorChanged() { | 303 void ManagedUserService::OnDefaultFilteringBehaviorChanged() { |
| 303 DCHECK(ProfileIsManaged()); | 304 DCHECK(ProfileIsManaged()); |
| 304 | 305 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); | 442 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); |
| 442 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); | 443 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); |
| 443 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { | 444 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { |
| 444 bool allow = false; | 445 bool allow = false; |
| 445 bool result = it.value().GetAsBoolean(&allow); | 446 bool result = it.value().GetAsBoolean(&allow); |
| 446 DCHECK(result); | 447 DCHECK(result); |
| 447 (*url_map)[GURL(it.key())] = allow; | 448 (*url_map)[GURL(it.key())] = allow; |
| 448 } | 449 } |
| 449 url_filter_context_.SetManualURLs(url_map.Pass()); | 450 url_filter_context_.SetManualURLs(url_map.Pass()); |
| 450 } | 451 } |
| OLD | NEW |