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

Unified Diff: chrome/browser/intents/web_intents_registry.h

Issue 7601013: Web Intents: Hook up the register intent InfoBar with the WebIntentsRegistry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit fixes. Created 9 years, 4 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/intents/web_intent_data.cc ('k') | chrome/browser/intents/web_intents_registry_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/intents/web_intents_registry.h
diff --git a/chrome/browser/intents/web_intents_registry.h b/chrome/browser/intents/web_intents_registry.h
index 76c01dbd6b6fbf110f063ae8f95a4b6d472793ca..02ab4fdfd9db1471b0cda00bd207327f67864429 100644
--- a/chrome/browser/intents/web_intents_registry.h
+++ b/chrome/browser/intents/web_intents_registry.h
@@ -9,11 +9,14 @@
#include "base/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "chrome/browser/intents/web_intent_data.h"
+#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/webdata/web_data_service.h"
// Handles storing and retrieving of web intents in the web database.
// The registry provides filtering logic to retrieve specific types of intents.
-class WebIntentsRegistry : public WebDataServiceConsumer {
+class WebIntentsRegistry
+ : public WebDataServiceConsumer,
+ public ProfileKeyedService {
public:
// Unique identifier for intent queries.
typedef int QueryID;
@@ -31,14 +34,11 @@ class WebIntentsRegistry : public WebDataServiceConsumer {
virtual ~Consumer() {}
};
- WebIntentsRegistry();
- virtual ~WebIntentsRegistry();
-
// Initializes, binds to a valid WebDataService.
void Initialize(scoped_refptr<WebDataService> wds);
// Registers a web intent provider.
- void RegisterIntentProvider(const WebIntentData& intent);
+ virtual void RegisterIntentProvider(const WebIntentData& intent);
// Removes a web intent provider from the registry.
void UnregisterIntentProvider(const WebIntentData& intent);
@@ -47,11 +47,20 @@ class WebIntentsRegistry : public WebDataServiceConsumer {
// |consumer| must not be NULL.
QueryID GetIntentProviders(const string16& action, Consumer* consumer);
+ protected:
+ // Make sure that only WebIntentsRegistryFactory can create an instance of
+ // WebIntentsRegistry.
+ friend class WebIntentsRegistryFactory;
+ friend class WebIntentsRegistryTest;
+
+ WebIntentsRegistry();
+ virtual ~WebIntentsRegistry();
+
private:
struct IntentsQuery;
// Maps web data requests to intents queries.
- // Allows OnWebDataServiceRequestDone to forward to appropiate consumer.
+ // Allows OnWebDataServiceRequestDone to forward to appropriate consumer.
typedef base::hash_map<WebDataService::Handle, IntentsQuery*> QueryMap;
// WebDataServiceConsumer implementation.
« no previous file with comments | « chrome/browser/intents/web_intent_data.cc ('k') | chrome/browser/intents/web_intents_registry_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698