Index: chrome/browser/webdata/web_intents_table.h |
diff --git a/chrome/browser/webdata/web_intents_table.h b/chrome/browser/webdata/web_intents_table.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..100cb6929eac2fca3a7b89d0c53ecf324d989469 |
--- /dev/null |
+++ b/chrome/browser/webdata/web_intents_table.h |
@@ -0,0 +1,65 @@ |
+// Copyright (c) 2011 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. |
+ |
+#ifndef CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ |
+#define CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ |
+#pragma once |
+ |
+#include "base/basictypes.h" |
+#include "base/string16.h" |
+#include "googleurl/src/gurl.h" |
+#include "chrome/browser/webdata/web_database_table.h" |
+ |
+#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.
|
+ |
+// Describes the relevant elements of a WebIntent. |
+// 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 :)
|
+// for WebIntents is in place. |
+struct WebIntentData { |
+ GURL service_url; // URL for service invocation. |
+ string16 action; // Name of action provided by service. |
+ string16 type; // MIME type of data accepted by service. |
+}; |
+ |
+// This class manages the WebIntents table within the SQLite database passed |
+// to the constructor. It expects the following schema: |
+// |
+// web_intents |
+// service_url URL for service invocation. |
+// action Name of action provided by the service. |
+// type MIME type of data accepted by the service. |
+// |
+// Intents are uniquely identified by the <service_url,action,type> tuple. |
+// |
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.
|
+class WebIntentsTable : public WebDatabaseTable { |
+ public: |
+ WebIntentsTable(sql::Connection* db, sql::MetaTable* meta_table); |
+ 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.
|
+ |
+ // WebDatabaseTable implementation. |
+ virtual bool Init(); |
+ virtual bool IsSyncable(); |
+ |
+ // Adds a web intent to the WebIntents table. If intent already exists, |
+ // replaces it. |
+ |
James Hawkins
2011/07/26 21:48:41
Remove blank line.
groby-ooo-7-16
2011/07/26 23:12:34
Done.
|
+ bool SetWebIntent(const string16& action, |
+ const string16& type, |
+ const GURL& service_url); |
+ |
+ // Retrieve all intents from WebIntents table that match |action|. |
+ bool GetWebIntents(const string16& action, |
+ std::vector<WebIntentData>* intents); |
+ |
+ 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.
|
+ const string16& type, |
+ const GURL& service_url); |
+ |
+ private: |
+ 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.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(WebIntentsTable); |
+}; |
+ |
+#endif // CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_ |