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

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

Issue 6410115: Adds navigator.registerProtocolHandler. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Responded to comments, simplified file format. Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 27c51ca17e032af2e46d3785a4a278f1f61495b0..5210fc846122887f66c9a3403a18b40586486782 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/chrome_blob_storage_context.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/dom_ui/ntp_resource_cache.h"
#include "chrome/browser/download/download_manager.h"
@@ -337,6 +338,8 @@ ProfileImpl::ProfileImpl(const FilePath& path)
GetPolicyContext()->Initialize();
+ InitRegisteredProtocolHandlers();
+
clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit);
// Log the profile size after a reasonable startup delay.
@@ -486,6 +489,13 @@ void ProfileImpl::InitWebResources() {
web_resource_service_->StartAfterDelay();
}
+void ProfileImpl::InitRegisteredProtocolHandlers() {
+ if (protocol_handler_registry_)
+ return;
+ protocol_handler_registry_ = new ProtocolHandlerRegistry(this);
+ protocol_handler_registry_->Load();
+}
+
NTPResourceCache* ProfileImpl::GetNTPResourceCache() {
if (!ntp_resource_cache_.get())
ntp_resource_cache_.reset(new NTPResourceCache(this));
@@ -1142,6 +1152,10 @@ BookmarkModel* ProfileImpl::GetBookmarkModel() {
return bookmark_bar_model_.get();
}
+ProtocolHandlerRegistry* ProfileImpl::GetProtocolHandlerRegistry() {
+ return protocol_handler_registry_.get();
+}
+
bool ProfileImpl::IsSameProfile(Profile* profile) {
if (profile == static_cast<Profile*>(this))
return true;

Powered by Google App Engine
This is Rietveld 408576698