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

Side by Side Diff: chrome/browser/webdata/web_intents_table.h

Issue 7461089: First implementation of web intents table. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Final 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/webdata/web_database.cc ('k') | chrome/browser/webdata/web_intents_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_
6 #define CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_
7 #pragma once
8
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/string16.h"
13 #include "googleurl/src/gurl.h"
14 #include "chrome/browser/webdata/web_database_table.h"
15
16 // Describes the relevant elements of a WebIntent.
17 // TODO(groby): Will need to be moved to different place once more
18 // infrastructure for WebIntents is in place.
19 struct WebIntentData {
20 GURL service_url; // URL for service invocation.
21 string16 action; // Name of action provided by service.
22 string16 type; // MIME type of data accepted by service.
23 };
24
25 // This class manages the WebIntents table within the SQLite database passed
26 // to the constructor. It expects the following schema:
27 //
28 // web_intents
29 // service_url URL for service invocation.
30 // action Name of action provided by the service.
31 // type MIME type of data accepted by the service.
32 //
33 // Intents are uniquely identified by the <service_url,action,type> tuple.
34 class WebIntentsTable : public WebDatabaseTable {
35 public:
36 WebIntentsTable(sql::Connection* db, sql::MetaTable* meta_table);
37 virtual ~WebIntentsTable();
38
39 // WebDatabaseTable implementation.
40 virtual bool Init();
41 virtual bool IsSyncable();
42
43 // Adds a web intent to the WebIntents table. If intent already exists,
44 // replaces it.
45 bool SetWebIntent(const string16& action,
46 const string16& type,
47 const GURL& service_url);
48
49 // Retrieve all intents from WebIntents table that match |action|.
50 bool GetWebIntents(const string16& action,
51 std::vector<WebIntentData>* intents);
52
53 // Removes intent from WebIntents table - must match all parameters exactly.
54 bool RemoveWebIntent(const string16& action,
55 const string16& type,
56 const GURL& service_url);
57
58 private:
59 DISALLOW_COPY_AND_ASSIGN(WebIntentsTable);
60 };
61
62 #endif // CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_
OLDNEW
« no previous file with comments | « chrome/browser/webdata/web_database.cc ('k') | chrome/browser/webdata/web_intents_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698