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

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

Issue 220053002: Remove ExtensionService::GetInstalledExtensionByUrl(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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::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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698