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

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

Issue 315573003: Remove PermissionsData::ForExtension() completely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 // BrowserContextKeyedService and use ExtensionRegistryObserver. 1037 // BrowserContextKeyedService and use ExtensionRegistryObserver.
1038 profile_->GetExtensionSpecialStoragePolicy()-> 1038 profile_->GetExtensionSpecialStoragePolicy()->
1039 GrantRightsForExtension(extension); 1039 GrantRightsForExtension(extension);
1040 1040
1041 // TODO(kalman): This is broken. The crash reporter is process-wide so doesn't 1041 // TODO(kalman): This is broken. The crash reporter is process-wide so doesn't
1042 // work properly multi-profile. Besides which, it should be using 1042 // work properly multi-profile. Besides which, it should be using
1043 // ExtensionRegistryObserver. See http://crbug.com/355029. 1043 // ExtensionRegistryObserver. See http://crbug.com/355029.
1044 UpdateActiveExtensionsInCrashReporter(); 1044 UpdateActiveExtensionsInCrashReporter();
1045 1045
1046 const extensions::PermissionsData* permissions_data = 1046 const extensions::PermissionsData* permissions_data =
1047 extensions::PermissionsData::ForExtension(extension); 1047 extension->permissions_data();
1048 1048
1049 // If the extension has permission to load chrome://favicon/ resources we need 1049 // If the extension has permission to load chrome://favicon/ resources we need
1050 // to make sure that the FaviconSource is registered with the 1050 // to make sure that the FaviconSource is registered with the
1051 // ChromeURLDataManager. 1051 // ChromeURLDataManager.
1052 if (permissions_data->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { 1052 if (permissions_data->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) {
1053 FaviconSource* favicon_source = new FaviconSource(profile_, 1053 FaviconSource* favicon_source = new FaviconSource(profile_,
1054 FaviconSource::FAVICON); 1054 FaviconSource::FAVICON);
1055 content::URLDataSource::Add(profile_, favicon_source); 1055 content::URLDataSource::Add(profile_, favicon_source);
1056 } 1056 }
1057 1057
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 } 2549 }
2550 2550
2551 void ExtensionService::OnProfileDestructionStarted() { 2551 void ExtensionService::OnProfileDestructionStarted() {
2552 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2552 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2553 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2553 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2554 it != ids_to_unload.end(); 2554 it != ids_to_unload.end();
2555 ++it) { 2555 ++it) {
2556 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2556 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2557 } 2557 }
2558 } 2558 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698