Index: chrome/browser/profiles/profile_impl_io_data.cc |
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc |
index a096dd17c7b32a2df962dbdce61b56194fbd7778..f8d352996c372d8e513830a606f005cb51062ab1 100644 |
--- a/chrome/browser/profiles/profile_impl_io_data.cc |
+++ b/chrome/browser/profiles/profile_impl_io_data.cc |
@@ -18,6 +18,7 @@ |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
+#include "chrome/browser/extensions/extension_protocols.h" |
#include "chrome/browser/io_thread.h" |
#include "chrome/browser/net/chrome_net_log.h" |
#include "chrome/browser/net/chrome_network_delegate.h" |
@@ -593,6 +594,15 @@ ProfileImplIOData::InitializeAppRequestContext( |
network_delegate(), |
ftp_factory_.get()); |
} else { |
+ // TODO(fsamuel): It's always safe to install an extension protocol handler |
+ // here because the decision whether to allow a resource load happens in |
+ // ExtensionProtocolHandler::MaybeCreateJob. However, this code needs to be |
+ // refactored so that it does not depend on whether or not the partition |
+ // is in memory. |
+ job_factory->SetProtocolHandler( |
+ extensions::kExtensionScheme, |
+ CreateExtensionProtocolHandler(is_incognito(), |
+ GetExtensionInfoMap())); |
top_job_factory = job_factory.PassAs<net::URLRequestJobFactory>(); |
} |
context->SetJobFactory(top_job_factory.Pass()); |