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

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: Created 8 years 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "chrome/browser/extensions/extension_disabled_ui.h" 45 #include "chrome/browser/extensions/extension_disabled_ui.h"
46 #include "chrome/browser/extensions/extension_error_reporter.h" 46 #include "chrome/browser/extensions/extension_error_reporter.h"
47 #include "chrome/browser/extensions/extension_error_ui.h" 47 #include "chrome/browser/extensions/extension_error_ui.h"
48 #include "chrome/browser/extensions/extension_host.h" 48 #include "chrome/browser/extensions/extension_host.h"
49 #include "chrome/browser/extensions/extension_install_ui.h" 49 #include "chrome/browser/extensions/extension_install_ui.h"
50 #include "chrome/browser/extensions/extension_process_manager.h" 50 #include "chrome/browser/extensions/extension_process_manager.h"
51 #include "chrome/browser/extensions/extension_sorting.h" 51 #include "chrome/browser/extensions/extension_sorting.h"
52 #include "chrome/browser/extensions/extension_special_storage_policy.h" 52 #include "chrome/browser/extensions/extension_special_storage_policy.h"
53 #include "chrome/browser/extensions/extension_sync_data.h" 53 #include "chrome/browser/extensions/extension_sync_data.h"
54 #include "chrome/browser/extensions/extension_system.h" 54 #include "chrome/browser/extensions/extension_system.h"
55 #include "chrome/browser/extensions/extension_web_ui.h"
56 #include "chrome/browser/extensions/external_install_ui.h" 55 #include "chrome/browser/extensions/external_install_ui.h"
57 #include "chrome/browser/extensions/external_provider_impl.h" 56 #include "chrome/browser/extensions/external_provider_impl.h"
58 #include "chrome/browser/extensions/external_provider_interface.h" 57 #include "chrome/browser/extensions/external_provider_interface.h"
59 #include "chrome/browser/extensions/installed_loader.h" 58 #include "chrome/browser/extensions/installed_loader.h"
60 #include "chrome/browser/extensions/lazy_background_task_queue.h" 59 #include "chrome/browser/extensions/lazy_background_task_queue.h"
61 #include "chrome/browser/extensions/management_policy.h" 60 #include "chrome/browser/extensions/management_policy.h"
62 #include "chrome/browser/extensions/pending_extension_manager.h" 61 #include "chrome/browser/extensions/pending_extension_manager.h"
63 #include "chrome/browser/extensions/permissions_updater.h" 62 #include "chrome/browser/extensions/permissions_updater.h"
64 #include "chrome/browser/extensions/platform_app_launcher.h" 63 #include "chrome/browser/extensions/platform_app_launcher.h"
65 #include "chrome/browser/extensions/settings/settings_frontend.h" 64 #include "chrome/browser/extensions/settings/settings_frontend.h"
66 #include "chrome/browser/extensions/shell_window_registry.h" 65 #include "chrome/browser/extensions/shell_window_registry.h"
67 #include "chrome/browser/extensions/unpacked_installer.h" 66 #include "chrome/browser/extensions/unpacked_installer.h"
68 #include "chrome/browser/extensions/updater/extension_updater.h" 67 #include "chrome/browser/extensions/updater/extension_updater.h"
69 #include "chrome/browser/net/chrome_url_request_context.h" 68 #include "chrome/browser/net/chrome_url_request_context.h"
70 #include "chrome/browser/prefs/pref_service.h" 69 #include "chrome/browser/prefs/pref_service.h"
71 #include "chrome/browser/profiles/profile.h" 70 #include "chrome/browser/profiles/profile.h"
72 #include "chrome/browser/profiles/profile_manager.h" 71 #include "chrome/browser/profiles/profile_manager.h"
73 #include "chrome/browser/themes/theme_service.h" 72 #include "chrome/browser/themes/theme_service.h"
74 #include "chrome/browser/themes/theme_service_factory.h" 73 #include "chrome/browser/themes/theme_service_factory.h"
75 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 74 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
76 #include "chrome/browser/ui/webui/favicon_source.h" 75 #include "chrome/browser/ui/webui/favicon_source.h"
77 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" 76 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h"
78 #include "chrome/browser/ui/webui/theme_source.h" 77 #include "chrome/browser/ui/webui/theme_source.h"
79 #include "chrome/common/child_process_logging.h" 78 #include "chrome/common/child_process_logging.h"
80 #include "chrome/common/chrome_notification_types.h" 79 #include "chrome/common/chrome_notification_types.h"
81 #include "chrome/common/chrome_paths.h" 80 #include "chrome/common/chrome_paths.h"
82 #include "chrome/common/chrome_switches.h" 81 #include "chrome/common/chrome_switches.h"
83 #include "chrome/common/chrome_version_info.h" 82 #include "chrome/common/chrome_version_info.h"
83 #include "chrome/common/extensions/api/url_overrides/url_overrides_handler.h"
Joe Thomas 2012/12/21 20:17:05 I will remove this.
84 #include "chrome/common/extensions/extension.h" 84 #include "chrome/common/extensions/extension.h"
85 #include "chrome/common/extensions/extension_file_util.h" 85 #include "chrome/common/extensions/extension_file_util.h"
86 #include "chrome/common/extensions/extension_manifest_constants.h" 86 #include "chrome/common/extensions/extension_manifest_constants.h"
87 #include "chrome/common/extensions/extension_messages.h" 87 #include "chrome/common/extensions/extension_messages.h"
88 #include "chrome/common/extensions/extension_resource.h" 88 #include "chrome/common/extensions/extension_resource.h"
89 #include "chrome/common/extensions/feature_switch.h" 89 #include "chrome/common/extensions/feature_switch.h"
90 #include "chrome/common/extensions/features/feature.h" 90 #include "chrome/common/extensions/features/feature.h"
91 #include "chrome/common/extensions/manifest.h" 91 #include "chrome/common/extensions/manifest.h"
92 #include "chrome/common/pref_names.h" 92 #include "chrome/common/pref_names.h"
93 #include "chrome/common/url_constants.h" 93 #include "chrome/common/url_constants.h"
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 1072
1073 // Tell a random-ass collection of other subsystems about the new extension. 1073 // Tell a random-ass collection of other subsystems about the new extension.
1074 // TODO(aa): What should we do with all this goop? Can it move into the 1074 // TODO(aa): What should we do with all this goop? Can it move into the
1075 // relevant objects via EXTENSION_LOADED? 1075 // relevant objects via EXTENSION_LOADED?
1076 1076
1077 profile_->GetExtensionSpecialStoragePolicy()-> 1077 profile_->GetExtensionSpecialStoragePolicy()->
1078 GrantRightsForExtension(extension); 1078 GrantRightsForExtension(extension);
1079 1079
1080 UpdateActiveExtensionsInCrashReporter(); 1080 UpdateActiveExtensionsInCrashReporter();
1081 1081
1082 ExtensionWebUI::RegisterChromeURLOverrides(
1083 profile_, extension->GetChromeURLOverrides());
1084
1085 // If the extension has permission to load chrome://favicon/ resources we need 1082 // If the extension has permission to load chrome://favicon/ resources we need
1086 // to make sure that the FaviconSource is registered with the 1083 // to make sure that the FaviconSource is registered with the
1087 // ChromeURLDataManager. 1084 // ChromeURLDataManager.
1088 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { 1085 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) {
1089 FaviconSource* favicon_source = new FaviconSource(profile_, 1086 FaviconSource* favicon_source = new FaviconSource(profile_,
1090 FaviconSource::FAVICON); 1087 FaviconSource::FAVICON);
1091 ChromeURLDataManager::AddDataSource(profile_, favicon_source); 1088 ChromeURLDataManager::AddDataSource(profile_, favicon_source);
1092 } 1089 }
1093 1090
1094 #if !defined(OS_ANDROID) 1091 #if !defined(OS_ANDROID)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 Profile* host_profile = 1161 Profile* host_profile =
1165 Profile::FromBrowserContext(host->GetBrowserContext()); 1162 Profile::FromBrowserContext(host->GetBrowserContext());
1166 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile()) 1163 if (host_profile->GetOriginalProfile() == profile_->GetOriginalProfile())
1167 host->Send(new ExtensionMsg_Unloaded(extension->id())); 1164 host->Send(new ExtensionMsg_Unloaded(extension->id()));
1168 } 1165 }
1169 1166
1170 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason); 1167 system_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
1171 profile_->GetExtensionSpecialStoragePolicy()-> 1168 profile_->GetExtensionSpecialStoragePolicy()->
1172 RevokeRightsForExtension(extension); 1169 RevokeRightsForExtension(extension);
1173 1170
1174 ExtensionWebUI::UnregisterChromeURLOverrides(
1175 profile_, extension->GetChromeURLOverrides());
1176
1177 #if defined(OS_CHROMEOS) 1171 #if defined(OS_CHROMEOS)
1178 // Revoke external file access to third party extensions. 1172 // Revoke external file access to third party extensions.
1179 fileapi::FileSystemContext* filesystem_context = 1173 fileapi::FileSystemContext* filesystem_context =
1180 BrowserContext::GetDefaultStoragePartition(profile_)-> 1174 BrowserContext::GetDefaultStoragePartition(profile_)->
1181 GetFileSystemContext(); 1175 GetFileSystemContext();
1182 if (filesystem_context && filesystem_context->external_provider()) { 1176 if (filesystem_context && filesystem_context->external_provider()) {
1183 filesystem_context->external_provider()-> 1177 filesystem_context->external_provider()->
1184 RevokeAccessForExtension(extension->id()); 1178 RevokeAccessForExtension(extension->id());
1185 } 1179 }
1186 #endif 1180 #endif
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after
3130 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); 3124 scoped_refptr<const Extension> extension = GetInstalledExtension(*it);
3131 DCHECK(extension); 3125 DCHECK(extension);
3132 if (!extension) 3126 if (!extension)
3133 continue; 3127 continue;
3134 blacklisted_extensions_.Insert(extension); 3128 blacklisted_extensions_.Insert(extension);
3135 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); 3129 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
3136 } 3130 }
3137 3131
3138 IdentifyAlertableExtensions(); 3132 IdentifyAlertableExtensions();
3139 } 3133 }
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