| 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 location, | 261 location, |
| 262 creation_flags, | 262 creation_flags, |
| 263 mark_acknowledged)) { | 263 mark_acknowledged)) { |
| 264 return false; | 264 return false; |
| 265 } | 265 } |
| 266 | 266 |
| 267 update_once_all_providers_are_ready_ = true; | 267 update_once_all_providers_are_ready_ = true; |
| 268 return true; | 268 return true; |
| 269 } | 269 } |
| 270 | 270 |
| 271 const Extension* ExtensionService::GetInstalledExtensionByUrl( | |
| 272 const GURL& url) const { | |
| 273 return registry_->enabled_extensions().GetExtensionOrAppByURL(url); | |
| 274 } | |
| 275 | |
| 276 const Extension* ExtensionService::GetInstalledApp(const GURL& url) const { | 271 const Extension* ExtensionService::GetInstalledApp(const GURL& url) const { |
| 277 const Extension* extension = GetInstalledExtensionByUrl(url); | 272 const Extension* extension = |
| 273 registry_->enabled_extensions().GetExtensionOrAppByURL(url); |
| 278 return (extension && extension->is_app()) ? extension : NULL; | 274 return (extension && extension->is_app()) ? extension : NULL; |
| 279 } | 275 } |
| 280 | 276 |
| 281 bool ExtensionService::IsInstalledApp(const GURL& url) const { | 277 bool ExtensionService::IsInstalledApp(const GURL& url) const { |
| 282 return !!GetInstalledApp(url); | 278 return !!GetInstalledApp(url); |
| 283 } | 279 } |
| 284 | 280 |
| 285 // static | 281 // static |
| 286 // This function is used to implement the command-line switch | 282 // This function is used to implement the command-line switch |
| 287 // --uninstall-extension, and to uninstall an extension via sync. The LOG | 283 // --uninstall-extension, and to uninstall an extension via sync. The LOG |
| (...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 void ExtensionService::UnloadAllExtensionsInternal() { | 2656 void ExtensionService::UnloadAllExtensionsInternal() { |
| 2661 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); | 2657 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); |
| 2662 | 2658 |
| 2663 registry_->ClearAll(); | 2659 registry_->ClearAll(); |
| 2664 system_->runtime_data()->ClearAll(); | 2660 system_->runtime_data()->ClearAll(); |
| 2665 | 2661 |
| 2666 // TODO(erikkay) should there be a notification for this? We can't use | 2662 // TODO(erikkay) should there be a notification for this? We can't use |
| 2667 // EXTENSION_UNLOADED since that implies that the extension has been disabled | 2663 // EXTENSION_UNLOADED since that implies that the extension has been disabled |
| 2668 // or uninstalled. | 2664 // or uninstalled. |
| 2669 } | 2665 } |
| OLD | NEW |