Chromium Code Reviews| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 location, | 268 location, |
| 269 creation_flags, | 269 creation_flags, |
| 270 mark_acknowledged)) { | 270 mark_acknowledged)) { |
| 271 return false; | 271 return false; |
| 272 } | 272 } |
| 273 | 273 |
| 274 update_once_all_providers_are_ready_ = true; | 274 update_once_all_providers_are_ready_ = true; |
| 275 return true; | 275 return true; |
| 276 } | 276 } |
| 277 | 277 |
| 278 const Extension* ExtensionService::GetInstalledExtensionByUrl( | |
| 279 const GURL& url) const { | |
| 280 return registry_->enabled_extensions().GetExtensionOrAppByURL(url); | |
|
Yoyo Zhou
2014/03/31 21:36:33
Ugh, so this function had a misleading name too!
| |
| 281 } | |
| 282 | |
| 283 const Extension* ExtensionService::GetInstalledApp(const GURL& url) const { | 278 const Extension* ExtensionService::GetInstalledApp(const GURL& url) const { |
| 284 const Extension* extension = GetInstalledExtensionByUrl(url); | 279 const Extension* extension = |
| 280 registry_->enabled_extensions().GetExtensionOrAppByURL(url); | |
| 285 return (extension && extension->is_app()) ? extension : NULL; | 281 return (extension && extension->is_app()) ? extension : NULL; |
| 286 } | 282 } |
| 287 | 283 |
| 288 bool ExtensionService::IsInstalledApp(const GURL& url) const { | 284 bool ExtensionService::IsInstalledApp(const GURL& url) const { |
| 289 return !!GetInstalledApp(url); | 285 return !!GetInstalledApp(url); |
| 290 } | 286 } |
| 291 | 287 |
| 292 // static | 288 // static |
| 293 // This function is used to implement the command-line switch | 289 // This function is used to implement the command-line switch |
| 294 // --uninstall-extension, and to uninstall an extension via sync. The LOG | 290 // --uninstall-extension, and to uninstall an extension via sync. The LOG |
| (...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2757 void ExtensionService::UnloadAllExtensionsInternal() { | 2753 void ExtensionService::UnloadAllExtensionsInternal() { |
| 2758 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); | 2754 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); |
| 2759 | 2755 |
| 2760 registry_->ClearAll(); | 2756 registry_->ClearAll(); |
| 2761 system_->runtime_data()->ClearAll(); | 2757 system_->runtime_data()->ClearAll(); |
| 2762 | 2758 |
| 2763 // TODO(erikkay) should there be a notification for this? We can't use | 2759 // TODO(erikkay) should there be a notification for this? We can't use |
| 2764 // EXTENSION_UNLOADED since that implies that the extension has been disabled | 2760 // EXTENSION_UNLOADED since that implies that the extension has been disabled |
| 2765 // or uninstalled. | 2761 // or uninstalled. |
| 2766 } | 2762 } |
| OLD | NEW |