summaryrefslogtreecommitdiffstats
path: root/webkit/glue/feed.h
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 17:03:07 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 17:03:07 +0000
commit38c0e99c382e4bf5ba04720f207338dba103f67f (patch)
tree6919b371afc1c5141388a90f8d09d6e199b9d0d3 /webkit/glue/feed.h
parent1540cd50af4875ae49a4012015bac43ae17c2258 (diff)
downloadchromium_src-38c0e99c382e4bf5ba04720f207338dba103f67f.zip
chromium_src-38c0e99c382e4bf5ba04720f207338dba103f67f.tar.gz
chromium_src-38c0e99c382e4bf5ba04720f207338dba103f67f.tar.bz2
RSS feed support (part 1)
Part 1 is RSS feed auto-discovery. This will parse the web page header to find the feeds in the document and notify the browser to display the RSS icon in the toolbar. You can click on the icon, but it will just navigate to the first feed on the page, which (unless it has been designed to be browser friendly) will just dump XML as text on the user. For this reason I have disabled the code that makes the RSS icon appear and intend to enable it when we have a good landing page to display the XML. Review URL: http://codereview.chromium.org/43109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/feed.h')
-rw-r--r--webkit/glue/feed.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/webkit/glue/feed.h b/webkit/glue/feed.h
new file mode 100644
index 0000000..e475c4a
--- /dev/null
+++ b/webkit/glue/feed.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2009 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_COMMON_FEED_H_
+#define CHROME_COMMON_FEED_H_
+
+#include <string>
+#include <vector>
+
+#include "base/ref_counted.h"
+#include "googleurl/src/gurl.h"
+
+struct FeedItem {
+ // The feed title.
+ std::wstring title;
+ // The feed type, for example: "application/rss+xml". The type can be blank.
+ std::wstring type;
+ // The URL to subscribe to the feed.
+ GURL url;
+};
+
+class FeedList : public base::RefCounted<FeedList> {
+ public:
+ // We limit the number of feeds that can be sent so that a rouge renderer
+ // doesn't cause excessive memory usage in the browser process by specifying
+ // a huge number of RSS feeds for the browser to parse.
+ static const size_t kMaxFeeds = 50;
+
+ FeedList() {}
+
+ void Add(const FeedItem &item) {
+ list_.push_back(item);
+ }
+
+ const std::vector<FeedItem>& list() const {
+ return list_;
+ }
+
+ private:
+ std::vector<FeedItem> list_;
+
+ DISALLOW_COPY_AND_ASSIGN(FeedList);
+};
+
+#endif // CHROME_COMMON_FEED_H_