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::GetInstalledApp(const GURL& url) const { | |
272 const Extension* extension = | |
273 registry_->enabled_extensions().GetExtensionOrAppByURL(url); | |
274 return (extension && extension->is_app()) ? extension : NULL; | |
275 } | |
276 | |
277 bool ExtensionService::IsInstalledApp(const GURL& url) const { | |
278 return !!GetInstalledApp(url); | |
279 } | |
280 | |
281 // static | 271 // static |
282 // This function is used to implement the command-line switch | 272 // This function is used to implement the command-line switch |
283 // --uninstall-extension, and to uninstall an extension via sync. The LOG | 273 // --uninstall-extension, and to uninstall an extension via sync. The LOG |
284 // statements within this function are used to inform the user if the uninstall | 274 // statements within this function are used to inform the user if the uninstall |
285 // cannot be done. | 275 // cannot be done. |
286 bool ExtensionService::UninstallExtensionHelper( | 276 bool ExtensionService::UninstallExtensionHelper( |
287 ExtensionService* extensions_service, | 277 ExtensionService* extensions_service, |
288 const std::string& extension_id) { | 278 const std::string& extension_id) { |
289 // We can't call UninstallExtension with an invalid extension ID. | 279 // We can't call UninstallExtension with an invalid extension ID. |
290 if (!extensions_service->GetInstalledExtension(extension_id)) { | 280 if (!extensions_service->GetInstalledExtension(extension_id)) { |
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2656 void ExtensionService::UnloadAllExtensionsInternal() { | 2646 void ExtensionService::UnloadAllExtensionsInternal() { |
2657 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); | 2647 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); |
2658 | 2648 |
2659 registry_->ClearAll(); | 2649 registry_->ClearAll(); |
2660 system_->runtime_data()->ClearAll(); | 2650 system_->runtime_data()->ClearAll(); |
2661 | 2651 |
2662 // TODO(erikkay) should there be a notification for this? We can't use | 2652 // TODO(erikkay) should there be a notification for this? We can't use |
2663 // EXTENSION_UNLOADED since that implies that the extension has been disabled | 2653 // EXTENSION_UNLOADED since that implies that the extension has been disabled |
2664 // or uninstalled. | 2654 // or uninstalled. |
2665 } | 2655 } |
OLD | NEW |