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

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: Fixed review issues. Created 9 years, 5 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
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 "base/basictypes.h"
10 #include "base/string16.h"
11 #include "googleurl/src/gurl.h"
12 #include "chrome/browser/webdata/web_database_table.h"
13
14 #include <vector>
James Hawkins 2011/07/26 21:48:41 C++ includes go before chrome includes.
groby-ooo-7-16 2011/07/26 23:12:34 Done.
15
16 // Describes the relevant elements of a WebIntent.
17 // TODO: Will need to be moved to different place once more infrastructure
James Hawkins 2011/07/26 21:48:41 Always add an ldap to a TODO. Feel free to use min
groby-ooo-7-16 2011/07/26 23:12:34 Keeping it mine for now :)
18 // 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 //
James Hawkins 2011/07/26 21:48:41 Remove this last empty comment line.
groby-ooo-7-16 2011/07/26 23:12:34 Done.
35 class WebIntentsTable : public WebDatabaseTable {
36 public:
37 WebIntentsTable(sql::Connection* db, sql::MetaTable* meta_table);
38 virtual ~WebIntentsTable() {}
James Hawkins 2011/07/26 21:48:41 Move this implementation to the source file as wel
groby-ooo-7-16 2011/07/26 23:12:34 Done.
39
40 // WebDatabaseTable implementation.
41 virtual bool Init();
42 virtual bool IsSyncable();
43
44 // Adds a web intent to the WebIntents table. If intent already exists,
45 // replaces it.
46
James Hawkins 2011/07/26 21:48:41 Remove blank line.
groby-ooo-7-16 2011/07/26 23:12:34 Done.
47 bool SetWebIntent(const string16& action,
48 const string16& type,
49 const GURL& service_url);
50
51 // Retrieve all intents from WebIntents table that match |action|.
52 bool GetWebIntents(const string16& action,
53 std::vector<WebIntentData>* intents);
54
55 bool RemoveWebIntent(const string16& action,
James Hawkins 2011/07/26 21:48:41 Document this method (yes, I know it's somewhat ob
groby-ooo-7-16 2011/07/26 23:12:34 Done.
56 const string16& type,
57 const GURL& service_url);
58
59 private:
60 bool InitWebIntentsTable();
James Hawkins 2011/07/26 21:48:41 This method is no longer used; remove.
groby-ooo-7-16 2011/07/26 23:12:34 Done.
61
62 DISALLOW_COPY_AND_ASSIGN(WebIntentsTable);
63 };
64
65 #endif // CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698