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

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: 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
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