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

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

Issue 11660016: Move the parsing of "chrome_url_overrides" out of Extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch-rebased Created 7 years, 11 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "chrome/browser/extensions/extension_disabled_ui.h" 46 #include "chrome/browser/extensions/extension_disabled_ui.h"
47 #include "chrome/browser/extensions/extension_error_reporter.h" 47 #include "chrome/browser/extensions/extension_error_reporter.h"
48 #include "chrome/browser/extensions/extension_error_ui.h" 48 #include "chrome/browser/extensions/extension_error_ui.h"
49 #include "chrome/browser/extensions/extension_host.h" 49 #include "chrome/browser/extensions/extension_host.h"
50 #include "chrome/browser/extensions/extension_install_ui.h" 50 #include "chrome/browser/extensions/extension_install_ui.h"
51 #include "chrome/browser/extensions/extension_process_manager.h" 51 #include "chrome/browser/extensions/extension_process_manager.h"
52 #include "chrome/browser/extensions/extension_sorting.h" 52 #include "chrome/browser/extensions/extension_sorting.h"
53 #include "chrome/browser/extensions/extension_special_storage_policy.h" 53 #include "chrome/browser/extensions/extension_special_storage_policy.h"
54 #include "chrome/browser/extensions/extension_sync_data.h" 54 #include "chrome/browser/extensions/extension_sync_data.h"
55 #include "chrome/browser/extensions/extension_system.h" 55 #include "chrome/browser/extensions/extension_system.h"
56 #include "chrome/browser/extensions/extension_web_ui.h"
57 #include "chrome/browser/extensions/external_install_ui.h" 56 #include "chrome/browser/extensions/external_install_ui.h"
58 #include "chrome/browser/extensions/external_provider_impl.h" 57 #include "chrome/browser/extensions/external_provider_impl.h"
59 #include "chrome/browser/extensions/external_provider_interface.h" 58 #include "chrome/browser/extensions/external_provider_interface.h"
60 #include "chrome/browser/extensions/installed_loader.h" 59 #include "chrome/browser/extensions/installed_loader.h"
61 #include "chrome/browser/extensions/lazy_background_task_queue.h" 60 #include "chrome/browser/extensions/lazy_background_task_queue.h"
62 #include "chrome/browser/extensions/management_policy.h" 61 #include "chrome/browser/extensions/management_policy.h"
63 #include "chrome/browser/extensions/pending_extension_manager.h" 62 #include "chrome/browser/extensions/pending_extension_manager.h"
64 #include "chrome/browser/extensions/permissions_updater.h" 63 #include "chrome/browser/extensions/permissions_updater.h"
65 #include "chrome/browser/extensions/platform_app_launcher.h" 64 #include "chrome/browser/extensions/platform_app_launcher.h"
66 #include "chrome/browser/extensions/shell_window_registry.h" 65 #include "chrome/browser/extensions/shell_window_registry.h"
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 1056
1058 // Tell a random-ass collection of other subsystems about the new extension. 1057 // Tell a random-ass collection of other subsystems about the new extension.
1059 // TODO(aa): What should we do with all this goop? Can it move into the 1058 // TODO(aa): What should we do with all this goop? Can it move into the
1060 // relevant objects via EXTENSION_LOADED? 1059 // relevant objects via EXTENSION_LOADED?
1061 1060
1062 profile_->GetExtensionSpecialStoragePolicy()-> 1061 profile_->GetExtensionSpecialStoragePolicy()->
1063 GrantRightsForExtension(extension); 1062 GrantRightsForExtension(extension);
1064 1063
1065 UpdateActiveExtensionsInCrashReporter(); 1064 UpdateActiveExtensionsInCrashReporter();
1066 1065
1067 ExtensionWebUI::RegisterChromeURLOverrides(
1068 profile_, extension->GetChromeURLOverrides());
1069
1070 // If the extension has permission to load chrome://favicon/ resources we need 1066 // If the extension has permission to load chrome://favicon/ resources we need
1071 // to make sure that the FaviconSource is registered with the 1067 // to make sure that the FaviconSource is registered with the
1072 // ChromeURLDataManager. 1068 // ChromeURLDataManager.
1073 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { 1069 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) {
1074 FaviconSource* favicon_source = new FaviconSource(profile_, 1070 FaviconSource* favicon_source = new FaviconSource(profile_,
1075 FaviconSource::FAVICON); 1071 FaviconSource::FAVICON);
1076 ChromeURLDataManager::AddDataSource(profile_, favicon_source); 1072 ChromeURLDataManager::AddDataSource(profile_, favicon_source);
1077 } 1073 }
1078 1074
1079 #if !defined(OS_ANDROID) 1075 #if !defined(OS_ANDROID)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 Profile* host_profile = 1147 Profile* host_profile =
1152 Profile::FromBrowserContext(host->GetBrowserContext()); 1148 Profile::FromBrowserContext(host->GetBrowserContext());
1153 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) 1149 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile())
1154 host->Send(new ExtensionMsg_Unloaded(extension->id())); 1150 host->Send(new ExtensionMsg_Unloaded(extension->id()));
1155 } 1151 }
1156 1152
1157 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason); 1153 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
1158 profile_->GetExtensionSpecialStoragePolicy()-> 1154 profile_->GetExtensionSpecialStoragePolicy()->
1159 RevokeRightsForExtension(extension); 1155 RevokeRightsForExtension(extension);
1160 1156
1161 ExtensionWebUI::UnregisterChromeURLOverrides(
1162 profile_, extension->GetChromeURLOverrides());
1163
1164 #if defined(OS_CHROMEOS) 1157 #if defined(OS_CHROMEOS)
1165 // Revoke external file access for the extension from its file system context. 1158 // Revoke external file access for the extension from its file system context.
1166 // It is safe to access the extension's storage partition at this point. The 1159 // It is safe to access the extension's storage partition at this point. The
1167 // storage partition may get destroyed only after the extension gets unloaded. 1160 // storage partition may get destroyed only after the extension gets unloaded.
1168 GURL site = extensions::ExtensionSystem::Get(profile_)->extension_service()-> 1161 GURL site = extensions::ExtensionSystem::Get(profile_)->extension_service()->
1169 GetSiteForExtensionId(extension->id()); 1162 GetSiteForExtensionId(extension->id());
1170 fileapi::FileSystemContext* filesystem_context = 1163 fileapi::FileSystemContext* filesystem_context =
1171 BrowserContext::GetStoragePartitionForSite(profile_, site)-> 1164 BrowserContext::GetStoragePartitionForSite(profile_, site)->
1172 GetFileSystemContext(); 1165 GetFileSystemContext();
1173 if (filesystem_context && filesystem_context->external_provider()) { 1166 if (filesystem_context && filesystem_context->external_provider()) {
(...skipping 1949 matching lines...) Expand 10 before | Expand all | Expand 10 after
3123 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); 3116 scoped_refptr<const Extension> extension = GetInstalledExtension(*it);
3124 DCHECK(extension); 3117 DCHECK(extension);
3125 if (!extension) 3118 if (!extension)
3126 continue; 3119 continue;
3127 blacklisted_extensions_.Insert(extension); 3120 blacklisted_extensions_.Insert(extension);
3128 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); 3121 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
3129 } 3122 }
3130 3123
3131 IdentifyAlertableExtensions(); 3124 IdentifyAlertableExtensions();
3132 } 3125 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_override_apitest.cc ('k') | chrome/browser/extensions/extension_web_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698