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

Unified Diff: chrome/browser/custom_handlers/protocol_handler_registry.h

Issue 7033018: Handler settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove in_unit_test_ Created 9 years, 7 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/app/generated_resources.grd ('k') | chrome/browser/custom_handlers/protocol_handler_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/custom_handlers/protocol_handler_registry.h
diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.h b/chrome/browser/custom_handlers/protocol_handler_registry.h
index eaeb0c6f893b585cbbbcde8e59e5e3c594dfe24a..500b551249bbc5e05504f640cf30cff87109cdcc 100644
--- a/chrome/browser/custom_handlers/protocol_handler_registry.h
+++ b/chrome/browser/custom_handlers/protocol_handler_registry.h
@@ -15,6 +15,7 @@
#include "base/values.h"
#include "chrome/browser/custom_handlers/protocol_handler.h"
#include "chrome/browser/profiles/profile.h"
+#include "content/common/notification_service.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job.h"
@@ -38,6 +39,10 @@ class ProtocolHandlerRegistry
virtual bool IsExternalHandlerRegistered(const std::string& protocol);
};
+ typedef std::map<std::string, ProtocolHandler> ProtocolHandlerMap;
+ typedef std::vector<ProtocolHandler> ProtocolHandlerList;
+ typedef std::map<std::string, ProtocolHandlerList> ProtocolHandlerMultiMap;
+
ProtocolHandlerRegistry(Profile* profile, Delegate* delegate);
~ProtocolHandlerRegistry();
@@ -64,9 +69,6 @@ class ProtocolHandlerRegistry
// it.
bool HasDefault(const std::string& scheme) const;
- // Returns true if there is a handler registered for the given protocol.
- bool HasHandler(const std::string& scheme);
-
// Loads a user's registered protocol handlers.
void Load();
@@ -77,6 +79,13 @@ class ProtocolHandlerRegistry
// exists.
const ProtocolHandler& GetHandlerFor(const std::string& scheme) const;
+ // Returns the offset in the list of handlers for a protocol of the default
+ // handler for that protocol.
+ int GetHandlerIndex(const std::string& scheme) const;
+
+ // Get the list of protocol handlers for the given scheme.
+ const ProtocolHandlerList* GetHandlersFor(const std::string& scheme) const;
+
// Yields a list of the protocols handled by this registry.
void GetHandledProtocols(std::vector<std::string>* output) const;
@@ -85,7 +94,7 @@ class ProtocolHandlerRegistry
bool CanSchemeBeOverridden(const std::string& scheme) const;
// Returns true if an identical protocol handler has already been registered.
- bool IsRegistered(const ProtocolHandler& handler);
+ bool IsRegistered(const ProtocolHandler& handler) const;
// Returns true if the protocol handler is being ignored.
bool IsIgnored(const ProtocolHandler& handler) const;
@@ -119,9 +128,8 @@ class ProtocolHandlerRegistry
private:
friend class base::RefCountedThreadSafe<ProtocolHandlerRegistry>;
- typedef std::map<std::string, ProtocolHandler> ProtocolHandlerMap;
- typedef std::vector<ProtocolHandler> ProtocolHandlerList;
- typedef std::map<std::string, ProtocolHandlerList> ProtocolHandlerMultiMap;
+ // Insert the given ProtocolHandler into the registry.
+ void InsertHandler(const ProtocolHandler& handler);
// Returns a JSON list of protocol handlers. The caller is responsible for
// deleting this Value.
@@ -131,6 +139,9 @@ class ProtocolHandlerRegistry
// responsible for deleting this Value.
Value* EncodeIgnoredHandlers();
+ // Sends a notification of the given type to the NotificationService.
+ void NotifyChanged();
+
// Registers a new protocol handler.
void RegisterProtocolHandler(const ProtocolHandler& handler);
@@ -148,8 +159,6 @@ class ProtocolHandlerRegistry
// Register
void IgnoreHandlerFromValue(const DictionaryValue* value);
- ProtocolHandlerList& GetHandlerListFor(const std::string& scheme);
-
// Map from protocols (strings) to protocol handlers.
ProtocolHandlerMultiMap protocol_handlers_;
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/custom_handlers/protocol_handler_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698