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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 10546083: Convert ProtocolHandlerRegistry to be a ProfileKeyedService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor docu-changes. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 36e24cb81346853aacea9b1fc9952951babe1eec..3d7d1583d8c1a972e3817f4d5764a76a985b174c 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -27,6 +27,7 @@
#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
+#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/download/download_service.h"
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/extensions/extension_event_router.h"
@@ -350,8 +351,6 @@ void ProfileImpl::DoFinalInit(bool is_new_profile) {
g_browser_process->background_mode_manager()->RegisterProfile(this);
}
- InitRegisteredProtocolHandlers();
-
InstantController::RecordMetrics(this);
FilePath cookie_path = GetPath();
@@ -453,33 +452,6 @@ void ProfileImpl::InitPromoResources() {
promo_resource_service_->StartAfterDelay();
}
-void ProfileImpl::InitRegisteredProtocolHandlers() {
- if (protocol_handler_registry_)
- return;
- protocol_handler_registry_ = new ProtocolHandlerRegistry(this,
- new ProtocolHandlerRegistry::Delegate());
-
- // Install predefined protocol handlers.
- InstallDefaultProtocolHandlers();
-
- protocol_handler_registry_->Load();
-}
-
-void ProfileImpl::InstallDefaultProtocolHandlers() {
-#if defined(OS_CHROMEOS)
- protocol_handler_registry_->AddPredefinedHandler(
- ProtocolHandler::CreateProtocolHandler(
- "mailto",
- GURL(l10n_util::GetStringUTF8(IDS_GOOGLE_MAILTO_HANDLER_URL)),
- l10n_util::GetStringUTF16(IDS_GOOGLE_MAILTO_HANDLER_NAME)));
- protocol_handler_registry_->AddPredefinedHandler(
- ProtocolHandler::CreateProtocolHandler(
- "webcal",
- GURL(l10n_util::GetStringUTF8(IDS_GOOGLE_WEBCAL_HANDLER_URL)),
- l10n_util::GetStringUTF16(IDS_GOOGLE_WEBCAL_HANDLER_NAME)));
-#endif
-}
-
FilePath ProfileImpl::last_selected_directory() {
return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
}
@@ -534,9 +506,6 @@ ProfileImpl::~ProfileImpl() {
if (pref_proxy_config_tracker_.get())
pref_proxy_config_tracker_->DetachFromPrefService();
- if (protocol_handler_registry_)
- protocol_handler_registry_->Finalize();
-
if (host_content_settings_map_)
host_content_settings_map_->ShutdownOnUIThread();
@@ -812,7 +781,11 @@ BookmarkModel* ProfileImpl::GetBookmarkModel() {
}
ProtocolHandlerRegistry* ProfileImpl::GetProtocolHandlerRegistry() {
- return protocol_handler_registry_.get();
+ // TODO(smckay): Update all existing callers to use
+ // ProtocolHandlerRegistryFactory. Once that's done, this method
+ // can be nuked from Profile and ProfileImpl.
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ return ProtocolHandlerRegistryFactory::GetForProfile(this);
}
bool ProfileImpl::IsSameProfile(Profile* profile) {
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698