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

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

Issue 9315010: RulesRegistry for declarative APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT for trybot testing Created 8 years, 10 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) 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 <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 18 matching lines...) Expand all
29 #include "chrome/browser/accessibility/accessibility_extension_api.h" 29 #include "chrome/browser/accessibility/accessibility_extension_api.h"
30 #include "chrome/browser/bookmarks/bookmark_extension_api.h" 30 #include "chrome/browser/bookmarks/bookmark_extension_api.h"
31 #include "chrome/browser/browser_process.h" 31 #include "chrome/browser/browser_process.h"
32 #include "chrome/browser/chrome_plugin_service_filter.h" 32 #include "chrome/browser/chrome_plugin_service_filter.h"
33 #include "chrome/browser/download/download_extension_api.h" 33 #include "chrome/browser/download/download_extension_api.h"
34 #include "chrome/browser/extensions/api/socket/socket_api_controller.h" 34 #include "chrome/browser/extensions/api/socket/socket_api_controller.h"
35 #include "chrome/browser/extensions/app_notification_manager.h" 35 #include "chrome/browser/extensions/app_notification_manager.h"
36 #include "chrome/browser/extensions/apps_promo.h" 36 #include "chrome/browser/extensions/apps_promo.h"
37 #include "chrome/browser/extensions/component_loader.h" 37 #include "chrome/browser/extensions/component_loader.h"
38 #include "chrome/browser/extensions/crx_installer.h" 38 #include "chrome/browser/extensions/crx_installer.h"
39 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h"
39 #include "chrome/browser/extensions/default_apps_trial.h" 40 #include "chrome/browser/extensions/default_apps_trial.h"
40 #include "chrome/browser/extensions/extension_browser_event_router.h" 41 #include "chrome/browser/extensions/extension_browser_event_router.h"
41 #include "chrome/browser/extensions/extension_cookies_api.h" 42 #include "chrome/browser/extensions/extension_cookies_api.h"
42 #include "chrome/browser/extensions/extension_data_deleter.h" 43 #include "chrome/browser/extensions/extension_data_deleter.h"
43 #include "chrome/browser/extensions/extension_error_reporter.h" 44 #include "chrome/browser/extensions/extension_error_reporter.h"
44 #include "chrome/browser/extensions/extension_global_error.h" 45 #include "chrome/browser/extensions/extension_global_error.h"
45 #include "chrome/browser/extensions/extension_host.h" 46 #include "chrome/browser/extensions/extension_host.h"
46 #include "chrome/browser/extensions/extension_input_ime_api.h" 47 #include "chrome/browser/extensions/extension_input_ime_api.h"
47 #include "chrome/browser/extensions/extension_management_api.h" 48 #include "chrome/browser/extensions/extension_management_api.h"
48 #include "chrome/browser/extensions/extension_preference_api.h" 49 #include "chrome/browser/extensions/extension_preference_api.h"
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i]; 1163 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i];
1163 UnregisterNaClModule(module.url); 1164 UnregisterNaClModule(module.url);
1164 nacl_modules_changed = true; 1165 nacl_modules_changed = true;
1165 } 1166 }
1166 1167
1167 if (nacl_modules_changed) 1168 if (nacl_modules_changed)
1168 UpdatePluginListWithNaClModules(); 1169 UpdatePluginListWithNaClModules();
1169 1170
1170 if (plugins_changed || nacl_modules_changed) 1171 if (plugins_changed || nacl_modules_changed)
1171 PluginService::GetInstance()->PurgePluginListCache(profile_, false); 1172 PluginService::GetInstance()->PurgePluginListCache(profile_, false);
1173
1174 if (rules_registry_service_.get())
1175 rules_registry_service_->OnExtensionUnloaded(extension->id());
not at google - send to devlin 2012/02/07 03:25:10 Rather than this, have the RulesRegistryService li
battre 2012/02/07 18:45:33 I had that before and removed it once I transferre
not at google - send to devlin 2012/02/07 23:54:57 I agree that it's a shame we use a broadcasting me
battre 2012/02/08 12:49:54 Done.
1172 } 1176 }
1173 1177
1174 void ExtensionService::UpdateExtensionBlacklist( 1178 void ExtensionService::UpdateExtensionBlacklist(
1175 const std::vector<std::string>& blacklist) { 1179 const std::vector<std::string>& blacklist) {
1176 // Use this set to indicate if an extension in the blacklist has been used. 1180 // Use this set to indicate if an extension in the blacklist has been used.
1177 std::set<std::string> blacklist_set; 1181 std::set<std::string> blacklist_set;
1178 for (unsigned int i = 0; i < blacklist.size(); ++i) { 1182 for (unsigned int i = 0; i < blacklist.size(); ++i) {
1179 if (Extension::IdIsValid(blacklist[i])) { 1183 if (Extension::IdIsValid(blacklist[i])) {
1180 blacklist_set.insert(blacklist[i]); 1184 blacklist_set.insert(blacklist[i]);
1181 } 1185 }
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 // 2696 //
2693 // To coexist with certain unit tests that don't have an IO thread message 2697 // To coexist with certain unit tests that don't have an IO thread message
2694 // loop available at ExtensionService shutdown, we lazy-initialize this 2698 // loop available at ExtensionService shutdown, we lazy-initialize this
2695 // object so that those cases neither create nor destroy a SocketController. 2699 // object so that those cases neither create nor destroy a SocketController.
2696 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2700 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2697 if (!socket_controller_) { 2701 if (!socket_controller_) {
2698 socket_controller_ = new extensions::SocketController(); 2702 socket_controller_ = new extensions::SocketController();
2699 } 2703 }
2700 return socket_controller_; 2704 return socket_controller_;
2701 } 2705 }
2706
2707 extensions::RulesRegistryService* ExtensionService::GetRulesRegistryService() {
2708 if (!rules_registry_service_.get())
2709 rules_registry_service_.reset(new extensions::RulesRegistryService());
2710 return rules_registry_service_.get();
2711 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698