Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 218683011: Remove ExtensionService::[Get|Is]InstalledApp() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ces_get_installed_ext_by_url
Patch Set: Latest master Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698