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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
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..5c6828822619c511dfb2a16932ebb49cba24ef45
--- /dev/null
+++ b/chrome/browser/webdata/web_intents_table.h
@@ -0,0 +1,57 @@
+// 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/string16.h"
James Hawkins 2011/07/26 20:21:53 #include "base/basictypes.h" for DISALLOW_COPY_AND
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+#include "googleurl/src/gurl.h"
+#include "chrome/browser/webdata/web_database_table.h"
+
+#include <vector>
+
+// Describes the relevant elements of a WebIntent.
James Hawkins 2011/07/26 20:21:53 Add a TODO noting this should likely be moved once
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+class WebIntent {
James Hawkins 2011/07/26 20:21:53 Use a struct.
James Hawkins 2011/07/26 20:46:18 s/WebIntent/WebIntentData/
groby-ooo-7-16 2011/07/26 21:38:37 Done.
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+ public:
+ string16 action;
James Hawkins 2011/07/26 20:21:53 Document the members.
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+ string16 type;
+ GURL service_url;
James Hawkins 2011/07/26 20:21:53 Would be nice to align the ordering of the members
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+};
+
+// This class manages the WebIntents tables within the SQLite database passed
James Hawkins 2011/07/26 20:21:53 For now, s/tables/table/.
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+// 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.
+//
+class WebIntentsTable : public WebDatabaseTable {
+ public:
+ WebIntentsTable(sql::Connection* db, sql::MetaTable* meta_table)
+ : WebDatabaseTable(db, meta_table) {}
James Hawkins 2011/07/26 20:21:53 Move implementation to source file, here and elsew
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+ virtual ~WebIntentsTable() {}
+
+ virtual bool Init();
James Hawkins 2011/07/26 20:21:53 // WebDatabaseTable implementation.
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+ virtual bool IsSyncable();
+
+ bool SetWebIntent(const string16& action,
James Hawkins 2011/07/26 20:21:53 Document these methods.
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+ const string16& type,
+ const GURL& service_url);
+
+ bool GetWebIntents(const string16& action,
+ std::vector<WebIntent>& intents);
James Hawkins 2011/07/26 20:21:53 Hmm, if we're modifying |intents|, this should be
groby-ooo-7-16 2011/07/26 21:38:37 Done.
+
+ bool RemoveWebIntent(const string16& action,
+ const string16& type,
+ const GURL& service_url);
+
+ private:
+ bool InitWebIntentsTable();
+
+ DISALLOW_COPY_AND_ASSIGN(WebIntentsTable);
+};
+
+#endif // CHROME_BROWSER_WEBDATA_WEB_INTENTS_TABLE_H_

Powered by Google App Engine
This is Rietveld 408576698