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

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

Issue 9355004: Merge 121330 - Modify schema to include defaulting information. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: 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
« no previous file with comments | « chrome/browser/intents/default_web_intent_service.cc ('k') | chrome/browser/webdata/web_intents_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/web_intents_table.h
===================================================================
--- chrome/browser/webdata/web_intents_table.h (revision 122525)
+++ chrome/browser/webdata/web_intents_table.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,6 +19,8 @@
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 @@
// 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.
//
-// Intents are uniquely identified by the <service_url,action,type> tuple.
+// Web Intent Services are uniquely identified by the <service_url,action,type>
+// 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.
+//
class WebIntentsTable : public WebDatabaseTable {
public:
WebIntentsTable(sql::Connection* db, sql::MetaTable* meta_table);
@@ -59,6 +78,25 @@
// 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);
+
+ // Get a list of all installed default services.
+ bool GetAllDefaultServices(
+ std::vector<DefaultWebIntentService>* default_services);
+
+ // Set a default service to be used on given intent invocations.
+ bool SetDefaultService(const DefaultWebIntentService& default_service);
+
+ // Removes a default |service| from table - must match the action, type,
+ // and url_prefix parameters exactly.
+ bool RemoveDefaultService(const DefaultWebIntentService& default_service);
+
private:
DISALLOW_COPY_AND_ASSIGN(WebIntentsTable);
};
« no previous file with comments | « chrome/browser/intents/default_web_intent_service.cc ('k') | chrome/browser/webdata/web_intents_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698