| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { | 272 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { |
| 273 const extensions::UnloadedExtensionInfo* extension_info = | 273 const extensions::UnloadedExtensionInfo* extension_info = |
| 274 content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); | 274 content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); |
| 275 if (!extensions::ManagedModeInfo::GetContentPackSiteList( | 275 if (!extensions::ManagedModeInfo::GetContentPackSiteList( |
| 276 extension_info->extension).empty()) { | 276 extension_info->extension).empty()) { |
| 277 UpdateSiteLists(); | 277 UpdateSiteLists(); |
| 278 } | 278 } |
| 279 break; | 279 break; |
| 280 } | 280 } |
| 281 case chrome::NOTIFICATION_EXTENSION_INSTALLED: | 281 case chrome::NOTIFICATION_EXTENSION_INSTALLED: { |
| 282 // Remove the temporary elevation. |
| 283 const extensions::Extension* extension = |
| 284 content::Details<const extensions::InstalledExtensionInfo>(details)-> |
| 285 extension; |
| 286 RemoveElevationForExtension(extension->id()); |
| 287 break; |
| 288 } |
| 282 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: { | 289 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: { |
| 283 // When an extension was installed or uninstalled, remove the temporary | 290 // Remove the temporary elevation. |
| 284 // elevation. | |
| 285 const extensions::Extension* extension = | 291 const extensions::Extension* extension = |
| 286 content::Details<extensions::Extension>(details).ptr(); | 292 content::Details<extensions::Extension>(details).ptr(); |
| 287 RemoveElevationForExtension(extension->id()); | 293 RemoveElevationForExtension(extension->id()); |
| 288 break; | 294 break; |
| 289 } | 295 } |
| 290 default: | 296 default: |
| 291 NOTREACHED(); | 297 NOTREACHED(); |
| 292 } | 298 } |
| 293 } | 299 } |
| 294 | 300 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); | 503 profile_->GetPrefs()->GetDictionary(prefs::kManagedModeManualURLs); |
| 498 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); | 504 scoped_ptr<std::map<GURL, bool> > url_map(new std::map<GURL, bool>()); |
| 499 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { | 505 for (DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) { |
| 500 bool allow = false; | 506 bool allow = false; |
| 501 bool result = it.value().GetAsBoolean(&allow); | 507 bool result = it.value().GetAsBoolean(&allow); |
| 502 DCHECK(result); | 508 DCHECK(result); |
| 503 (*url_map)[GURL(it.key())] = allow; | 509 (*url_map)[GURL(it.key())] = allow; |
| 504 } | 510 } |
| 505 url_filter_context_.SetManualURLs(url_map.Pass()); | 511 url_filter_context_.SetManualURLs(url_map.Pass()); |
| 506 } | 512 } |
| OLD | NEW |