diff options
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/navigation_entry.h | 10 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 9 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.cc | 24 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents.h | 2 |
4 files changed, 41 insertions, 4 deletions
diff --git a/chrome/browser/tab_contents/navigation_entry.h b/chrome/browser/tab_contents/navigation_entry.h index 55ed4f3..48e1750 100644 --- a/chrome/browser/tab_contents/navigation_entry.h +++ b/chrome/browser/tab_contents/navigation_entry.h @@ -15,6 +15,7 @@ #include "googleurl/src/gurl.h" #include "grit/theme_resources.h" #include "skia/include/SkBitmap.h" +#include "webkit/glue/feed.h" class NavigationController; @@ -323,6 +324,14 @@ class NavigationEntry { // if there is no navigation. bool IsViewSourceMode() const; + // Feed accessor. + void set_feedlist(scoped_refptr<FeedList> feedlist) { + feedlist_ = feedlist; + } + scoped_refptr<FeedList> feedlist() { + return feedlist_; + } + // Tracking stuff ------------------------------------------------------------ // The transition type indicates what the user did to move to this page from @@ -393,6 +402,7 @@ class NavigationEntry { std::string content_state_; int32 page_id_; SSLStatus ssl_; + scoped_refptr<FeedList> feedlist_; PageTransition::Type transition_type_; GURL user_typed_url_; bool has_post_data_; diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 89b7430..b7a2cc9 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -74,10 +74,11 @@ class TabContents : public PageNavigator, // Flags passed to the TabContentsDelegate.NavigationStateChanged to tell it // what has changed. Combine them to update more than one thing. enum InvalidateTypes { - INVALIDATE_URL = 1, // The URL has changed. - INVALIDATE_TITLE = 2, // The title has changed. - INVALIDATE_FAVICON = 4, // The favicon has changed. - INVALIDATE_LOAD = 8, // The loading state has changed + INVALIDATE_URL = 1, // The URL has changed. + INVALIDATE_TITLE = 2, // The title has changed. + INVALIDATE_FAVICON = 4, // The favicon has changed. + INVALIDATE_LOAD = 8, // The loading state has changed. + INVALIDATE_FEEDLIST = 16, // The Atom/RSS feed has changed. // Helper for forcing a refresh. INVALIDATE_EVERYTHING = 0xFFFFFFFF diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc index 5b935b5..1e50600 100644 --- a/chrome/browser/tab_contents/web_contents.cc +++ b/chrome/browser/tab_contents/web_contents.cc @@ -42,6 +42,7 @@ #include "net/base/mime_util.h" #include "net/base/net_errors.h" #include "net/base/registry_controlled_domain.h" +#include "webkit/glue/feed.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_WIN) @@ -807,6 +808,29 @@ void WebContents::UpdateTitle(RenderViewHost* rvh, NotifyNavigationStateChanged(INVALIDATE_TITLE); } +void WebContents::UpdateFeedList( + RenderViewHost* rvh, const ViewHostMsg_UpdateFeedList_Params& params) { + if (!controller()) + return; + + // We might have an old RenderViewHost sending messages, and we should ignore + // those messages. + if (rvh != render_view_host()) + return; + + NavigationEntry* entry = controller()->GetEntryWithPageID(type(), + GetSiteInstance(), + params.page_id); + if (!entry) + return; + + entry->set_feedlist(params.feedlist); + + // Broadcast notifications when the UI should be updated. + if (entry == controller()->GetEntryAtOffset(0)) + NotifyNavigationStateChanged(INVALIDATE_FEEDLIST); +} + void WebContents::UpdateEncoding(RenderViewHost* render_view_host, const std::wstring& encoding) { set_encoding(encoding); diff --git a/chrome/browser/tab_contents/web_contents.h b/chrome/browser/tab_contents/web_contents.h index 5a07b5f..5ac7526 100644 --- a/chrome/browser/tab_contents/web_contents.h +++ b/chrome/browser/tab_contents/web_contents.h @@ -301,6 +301,8 @@ class WebContents : public TabContents, virtual void UpdateTitle(RenderViewHost* render_view_host, int32 page_id, const std::wstring& title); + virtual void UpdateFeedList(RenderViewHost* render_view_host, + const ViewHostMsg_UpdateFeedList_Params& params); virtual void UpdateEncoding(RenderViewHost* render_view_host, const std::wstring& encoding); virtual void UpdateTargetURL(int32 page_id, const GURL& url); |