diff options
author | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-09 23:19:45 +0000 |
---|---|---|
committer | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-09 23:19:45 +0000 |
commit | 778cf547150c7ae1b7bc238d97844285e65111ef (patch) | |
tree | 96cc015c811a43c568321d2ce00a6374902a40c1 /chrome/browser/webdata/web_intents_table.h | |
parent | d87b638ae73de94c2bbd59468e0409c91abbe582 (diff) | |
download | chromium_src-778cf547150c7ae1b7bc238d97844285e65111ef.zip chromium_src-778cf547150c7ae1b7bc238d97844285e65111ef.tar.gz chromium_src-778cf547150c7ae1b7bc238d97844285e65111ef.tar.bz2 |
Modify schema to include defaulting information.
R=jhawkins@chromium.org,binji@chromium.org,groby@chromium.org
BUG=110636
TEST=None yet
Review URL: http://codereview.chromium.org/9104018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_intents_table.h')
-rw-r--r-- | chrome/browser/webdata/web_intents_table.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/chrome/browser/webdata/web_intents_table.h b/chrome/browser/webdata/web_intents_table.h index beb0c19..d97b4f6 100644 --- a/chrome/browser/webdata/web_intents_table.h +++ b/chrome/browser/webdata/web_intents_table.h @@ -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 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 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. // -// 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,25 @@ 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); + + // 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); }; |