OLD | NEW |
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "chrome/browser/search_engines/template_url_service.h" | 75 #include "chrome/browser/search_engines/template_url_service.h" |
76 #include "chrome/browser/search_engines/template_url_service_factory.h" | 76 #include "chrome/browser/search_engines/template_url_service_factory.h" |
77 #include "chrome/browser/sync/api/sync_change.h" | 77 #include "chrome/browser/sync/api/sync_change.h" |
78 #include "chrome/browser/sync/api/sync_error_factory.h" | 78 #include "chrome/browser/sync/api/sync_error_factory.h" |
79 #include "chrome/browser/themes/theme_service.h" | 79 #include "chrome/browser/themes/theme_service.h" |
80 #include "chrome/browser/themes/theme_service_factory.h" | 80 #include "chrome/browser/themes/theme_service_factory.h" |
81 #include "chrome/browser/ui/browser.h" | 81 #include "chrome/browser/ui/browser.h" |
82 #include "chrome/browser/ui/browser_list.h" | 82 #include "chrome/browser/ui/browser_list.h" |
83 #include "chrome/browser/ui/global_error_service.h" | 83 #include "chrome/browser/ui/global_error_service.h" |
84 #include "chrome/browser/ui/global_error_service_factory.h" | 84 #include "chrome/browser/ui/global_error_service_factory.h" |
85 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 85 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h" |
86 #include "chrome/browser/ui/webui/favicon_source.h" | 86 #include "chrome/browser/ui/webui/favicon_source.h" |
87 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 87 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
88 #include "chrome/common/child_process_logging.h" | 88 #include "chrome/common/child_process_logging.h" |
89 #include "chrome/common/chrome_notification_types.h" | 89 #include "chrome/common/chrome_notification_types.h" |
90 #include "chrome/common/chrome_paths.h" | 90 #include "chrome/common/chrome_paths.h" |
91 #include "chrome/common/chrome_switches.h" | 91 #include "chrome/common/chrome_switches.h" |
92 #include "chrome/common/extensions/extension.h" | 92 #include "chrome/common/extensions/extension.h" |
93 #include "chrome/common/extensions/extension_manifest_constants.h" | 93 #include "chrome/common/extensions/extension_manifest_constants.h" |
94 #include "chrome/common/extensions/extension_error_utils.h" | 94 #include "chrome/common/extensions/extension_error_utils.h" |
95 #include "chrome/common/extensions/extension_file_util.h" | 95 #include "chrome/common/extensions/extension_file_util.h" |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 omnibox_popup_icon_manager_.LoadIcon(extension); | 1058 omnibox_popup_icon_manager_.LoadIcon(extension); |
1059 omnibox_icon_manager_.LoadIcon(extension); | 1059 omnibox_icon_manager_.LoadIcon(extension); |
1060 } | 1060 } |
1061 | 1061 |
1062 // If the extension has permission to load chrome://favicon/ resources we need | 1062 // If the extension has permission to load chrome://favicon/ resources we need |
1063 // to make sure that the FaviconSource is registered with the | 1063 // to make sure that the FaviconSource is registered with the |
1064 // ChromeURLDataManager. | 1064 // ChromeURLDataManager. |
1065 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { | 1065 if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) { |
1066 FaviconSource* favicon_source = new FaviconSource(profile_, | 1066 FaviconSource* favicon_source = new FaviconSource(profile_, |
1067 FaviconSource::FAVICON); | 1067 FaviconSource::FAVICON); |
1068 profile_->GetChromeURLDataManager()->AddDataSource(favicon_source); | 1068 ChromeURLDataManagerFactory::GetForProfile(profile_)-> |
| 1069 AddDataSource(favicon_source); |
1069 } | 1070 } |
1070 // Same for chrome://thumb/ resources. | 1071 // Same for chrome://thumb/ resources. |
1071 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) { | 1072 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) { |
1072 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_); | 1073 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_); |
1073 profile_->GetChromeURLDataManager()->AddDataSource(thumbnail_source); | 1074 ChromeURLDataManagerFactory::GetForProfile(profile_)-> |
| 1075 AddDataSource(thumbnail_source); |
1074 } | 1076 } |
1075 | 1077 |
1076 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757. | 1078 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757. |
1077 bool plugins_changed = false; | 1079 bool plugins_changed = false; |
1078 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 1080 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
1079 const Extension::PluginInfo& plugin = extension->plugins()[i]; | 1081 const Extension::PluginInfo& plugin = extension->plugins()[i]; |
1080 PluginService::GetInstance()->RefreshPlugins(); | 1082 PluginService::GetInstance()->RefreshPlugins(); |
1081 PluginService::GetInstance()->AddExtraPluginPath(plugin.path); | 1083 PluginService::GetInstance()->AddExtraPluginPath(plugin.path); |
1082 plugins_changed = true; | 1084 plugins_changed = true; |
1083 ChromePluginServiceFilter* filter = | 1085 ChromePluginServiceFilter* filter = |
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2645 // To coexist with certain unit tests that don't have an IO thread message | 2647 // To coexist with certain unit tests that don't have an IO thread message |
2646 // loop available at ExtensionService shutdown, we lazy-initialize this | 2648 // loop available at ExtensionService shutdown, we lazy-initialize this |
2647 // object so that those cases neither create nor destroy an | 2649 // object so that those cases neither create nor destroy an |
2648 // APIResourceController. | 2650 // APIResourceController. |
2649 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2651 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2650 if (!api_resource_controller_) { | 2652 if (!api_resource_controller_) { |
2651 api_resource_controller_ = new extensions::APIResourceController(); | 2653 api_resource_controller_ = new extensions::APIResourceController(); |
2652 } | 2654 } |
2653 return api_resource_controller_; | 2655 return api_resource_controller_; |
2654 } | 2656 } |
OLD | NEW |