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

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

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Made ChromeURLDataManager's destructor virtual Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_system.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ChromeURLDataManager::AddDataSource(profile_, favicon_source);
1069 } 1069 }
1070 // Same for chrome://thumb/ resources. 1070 // Same for chrome://thumb/ resources.
1071 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) { 1071 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) {
1072 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_); 1072 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_);
1073 profile_->GetChromeURLDataManager()->AddDataSource(thumbnail_source); 1073 ChromeURLDataManagerFactory::GetForProfile(profile_)->
1074 AddDataSource(thumbnail_source);
1074 } 1075 }
1075 1076
1076 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757. 1077 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757.
1077 bool plugins_changed = false; 1078 bool plugins_changed = false;
1078 for (size_t i = 0; i < extension->plugins().size(); ++i) { 1079 for (size_t i = 0; i < extension->plugins().size(); ++i) {
1079 const Extension::PluginInfo& plugin = extension->plugins()[i]; 1080 const Extension::PluginInfo& plugin = extension->plugins()[i];
1080 PluginService::GetInstance()->RefreshPlugins(); 1081 PluginService::GetInstance()->RefreshPlugins();
1081 PluginService::GetInstance()->AddExtraPluginPath(plugin.path); 1082 PluginService::GetInstance()->AddExtraPluginPath(plugin.path);
1082 plugins_changed = true; 1083 plugins_changed = true;
1083 ChromePluginServiceFilter* filter = 1084 ChromePluginServiceFilter* filter =
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2645 // To coexist with certain unit tests that don't have an IO thread message 2646 // To coexist with certain unit tests that don't have an IO thread message
2646 // loop available at ExtensionService shutdown, we lazy-initialize this 2647 // loop available at ExtensionService shutdown, we lazy-initialize this
2647 // object so that those cases neither create nor destroy an 2648 // object so that those cases neither create nor destroy an
2648 // APIResourceController. 2649 // APIResourceController.
2649 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 2650 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
2650 if (!api_resource_controller_) { 2651 if (!api_resource_controller_) {
2651 api_resource_controller_ = new extensions::APIResourceController(); 2652 api_resource_controller_ = new extensions::APIResourceController();
2652 } 2653 }
2653 return api_resource_controller_; 2654 return api_resource_controller_;
2654 } 2655 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698