| Index: chrome/browser/custom_handlers/protocol_handler_registry.cc
|
| diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.cc b/chrome/browser/custom_handlers/protocol_handler_registry.cc
|
| index d81af988fc58af5d2e7f30e6b30679ff451d30bf..46bff5db78241e4cfe41f7f66f7ab223eec60820 100644
|
| --- a/chrome/browser/custom_handlers/protocol_handler_registry.cc
|
| +++ b/chrome/browser/custom_handlers/protocol_handler_registry.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/utf_string_conversions.h"
|
| #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.h"
|
| #include "chrome/browser/net/chrome_url_request_context.h"
|
| #include "chrome/browser/prefs/pref_service.h"
|
| @@ -35,7 +36,8 @@ ProtocolHandlerRegistry::ProtocolHandlerRegistry(Profile* profile,
|
| delegate_(delegate),
|
| enabled_(true),
|
| enabled_io_(enabled_),
|
| - is_loading_(false) {
|
| + is_loading_(false),
|
| + is_loaded_(false) {
|
| }
|
|
|
| ProtocolHandlerRegistry::~ProtocolHandlerRegistry() {
|
| @@ -195,6 +197,8 @@ bool ShouldRemoveHandlersNotInOS() {
|
| } // namespace
|
|
|
| void ProtocolHandlerRegistry::Load() {
|
| + // Any further default additions to the table will get rejected from now on.
|
| + is_loaded_ = true;
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| is_loading_ = true;
|
| PrefService* prefs = profile_->GetPrefs();
|
| @@ -591,6 +595,13 @@ void ProtocolHandlerRegistry::NotifyChanged() {
|
| content::NotificationService::NoDetails());
|
| }
|
|
|
| +void ProtocolHandlerRegistry::AddFixedHandler(const ProtocolHandler& handler) {
|
| + // If called after the load command was issued this function will fail.
|
| + DCHECK(!is_loaded_);
|
| + RegisterProtocolHandler(handler);
|
| + SetDefault(handler);
|
| +}
|
| +
|
| // IO thread methods -----------------------------------------------------------
|
|
|
| void ProtocolHandlerRegistry::ClearDefaultIO(const std::string& scheme) {
|
|
|