OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ | 5 #ifndef CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ |
6 #define CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ | 6 #define CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "chrome/browser/intents/web_intent_data.h" |
14 #include "chrome/browser/webdata/web_database_table.h" | 14 #include "chrome/browser/webdata/web_database_table.h" |
15 | 15 |
16 // Describes the relevant elements of a WebIntent. | 16 class GURL; |
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 | 17 |
25 // This class manages the WebIntents table within the SQLite database passed | 18 // This class manages the WebIntents table within the SQLite database passed |
26 // to the constructor. It expects the following schema: | 19 // to the constructor. It expects the following schema: |
27 // | 20 // |
28 // web_intents | 21 // web_intents |
29 // service_url URL for service invocation. | 22 // service_url URL for service invocation. |
30 // action Name of action provided by the service. | 23 // action Name of action provided by the service. |
31 // type MIME type of data accepted by the service. | 24 // type MIME type of data accepted by the service. |
32 // | 25 // |
33 // Intents are uniquely identified by the <service_url,action,type> tuple. | 26 // Intents are uniquely identified by the <service_url,action,type> tuple. |
(...skipping 19 matching lines...) Expand all Loading... |
53 // Removes intent from WebIntents table - must match all parameters exactly. | 46 // Removes intent from WebIntents table - must match all parameters exactly. |
54 bool RemoveWebIntent(const string16& action, | 47 bool RemoveWebIntent(const string16& action, |
55 const string16& type, | 48 const string16& type, |
56 const GURL& service_url); | 49 const GURL& service_url); |
57 | 50 |
58 private: | 51 private: |
59 DISALLOW_COPY_AND_ASSIGN(WebIntentsTable); | 52 DISALLOW_COPY_AND_ASSIGN(WebIntentsTable); |
60 }; | 53 }; |
61 | 54 |
62 #endif // CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ | 55 #endif // CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ |
OLD | NEW |