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

Unified Diff: chrome/browser/webdata/web_intents_table.h

Issue 9104018: Modify schema to include defaulting information. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix forward decl. Created 8 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/webdata/web_intents_table.h
diff --git a/chrome/browser/webdata/web_intents_table.h b/chrome/browser/webdata/web_intents_table.h
index beb0c19acbbc708ec5abcc300ecf8291c8bd3d29..a35851ac3f5de1e9c332fa7e7fb67e0a2f21e124 100644
--- a/chrome/browser/webdata/web_intents_table.h
+++ b/chrome/browser/webdata/web_intents_table.h
@@ -19,6 +19,8 @@ class Connection;
class MetaTable;
}
+struct DefaultWebIntentService;
+
// This class manages the WebIntents table within the SQLite database passed
// to the constructor. It expects the following schema:
//
@@ -26,8 +28,25 @@ class MetaTable;
// service_url URL for service invocation.
// action Name of action provided by the service.
// type MIME type of data accepted by the service.
+// title Title for the service page
+// disposition Either 'window' or 'inline' disposition.
+//
+// Web Intents Services are uniquely identified by the <service_url,action,type>
groby-ooo-7-16 2012/02/08 23:18:38 nit: Intent (no s)
Greg Billock 2012/02/08 23:34:06 ok
+// tuple.
+//
+// Also manages the defaults table:
+//
+// web_intents_defaults
+// action Intent action for this default.
+// type Intent type for this default.
+// url_prefix URL prefix for which the default is invoked.
+// user_date Epoch time when the user made this default.
+// suppression Set if the default is (temporarily) suppressed.
+// service_url The URL of a service in the web_intents table.
+// extension_url The URL for an extension handling intents.
+//
+// The defaults are scoped by action, then type, then url prefix.
//
-// Intents are uniquely identified by the <service_url,action,type> tuple.
class WebIntentsTable : public WebDatabaseTable {
public:
WebIntentsTable(sql::Connection* db, sql::MetaTable* meta_table);
@@ -59,6 +78,17 @@ class WebIntentsTable : public WebDatabaseTable {
// exactly.
bool RemoveWebIntentService(const webkit_glue::WebIntentServiceData& service);
+ // Get the default service to be used for the given intent invocation.
+ // If any overlapping defaults are found, they're placed in
+ // |default_services|, otherwise, it is untouched.
+ // Returns true if the method runs successfully, false on database error.
+ bool GetDefaultServices(
+ const string16& action,
+ std::vector<DefaultWebIntentService>* default_services);
+
+ // Set a default service to be used on given intent invocations.
+ bool SetDefaultService(const DefaultWebIntentService& default_service);
groby-ooo-7-16 2012/02/08 23:18:38 No way to remove default services?
Greg Billock 2012/02/08 23:34:06 Actually just adding that.
+
private:
DISALLOW_COPY_AND_ASSIGN(WebIntentsTable);
};

Powered by Google App Engine
This is Rietveld 408576698