diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 22:48:08 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 22:48:08 +0000 |
commit | cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066 (patch) | |
tree | 04db665d0a50888ece0b9e5c83695b7860381827 /chrome/browser | |
parent | 81cf6f77e3bf3a413220d9b28ba83d85567d9048 (diff) | |
download | chromium_src-cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066.zip chromium_src-cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066.tar.gz chromium_src-cbc0e9cc6651df9bb4a256c30c7d4a8fce36d066.tar.bz2 |
Fix bug 9812: Remove current RSS code in favor of new more generalized
PageAction code that serves the same purpose (and more).
BUG=9812
TEST=No test needed, this shouldn't result in any noticable difference
since the RSS parsing was disabled.
Review URL: http://codereview.chromium.org/100356
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/location_bar_view_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/location_bar_view_gtk.h | 1 | ||||
-rw-r--r-- | chrome/browser/location_bar.h | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 6 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 1 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host_delegate.h | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/navigation_entry.h | 10 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 19 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 13 | ||||
-rw-r--r-- | chrome/browser/toolbar_model.cc | 17 | ||||
-rw-r--r-- | chrome/browser/toolbar_model.h | 4 | ||||
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 78 | ||||
-rw-r--r-- | chrome/browser/views/location_bar_view.h | 31 |
14 files changed, 5 insertions, 196 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 145c600..646076e 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2350,9 +2350,6 @@ void Browser::ProcessPendingUIUpdates() { updated_stuff[contents] |= TabContents::INVALIDATE_FAVICON; } - if (flags & TabContents::INVALIDATE_FEEDLIST) - window()->GetLocationBar()->UpdateFeedIcon(); - if (flags & TabContents::INVALIDATE_PAGE_ACTIONS) window()->GetLocationBar()->UpdatePageActions(); diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc index 3ca70c4..8ef58b4 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/gtk/location_bar_view_gtk.cc @@ -181,14 +181,6 @@ void LocationBarViewGtk::FocusSearch() { location_entry_->SetFocus(); } -void LocationBarViewGtk::UpdateFeedIcon() { - // Hide our lack of a feed icon for now, since it's not fully implemented - // even on Windows yet. - FeedList* feeds = toolbar_model_->GetFeedList().get(); - if (feeds && feeds->list().size() > 0) - NOTIMPLEMENTED(); -} - void LocationBarViewGtk::UpdatePageActions() { NOTIMPLEMENTED(); } diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h index af472766..aa4866e 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.h +++ b/chrome/browser/gtk/location_bar_view_gtk.h @@ -69,7 +69,6 @@ class LocationBarViewGtk : public AutocompleteEditController, virtual void AcceptInputWithDisposition(WindowOpenDisposition); virtual void FocusLocation(); virtual void FocusSearch(); - virtual void UpdateFeedIcon(); virtual void UpdatePageActions(); virtual void SaveStateToContents(TabContents* contents); virtual void Revert(); diff --git a/chrome/browser/location_bar.h b/chrome/browser/location_bar.h index ccb4781..d885709 100644 --- a/chrome/browser/location_bar.h +++ b/chrome/browser/location_bar.h @@ -47,9 +47,6 @@ class LocationBar { // focus to it. virtual void FocusSearch() = 0; - // Update the state of the feed icon. - virtual void UpdateFeedIcon() = 0; - // Update the state of the page actions. virtual void UpdatePageActions() = 0; diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 5a0a0cf..8a602f0 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -771,7 +771,6 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) { OnQueryFormFieldAutofill) IPC_MESSAGE_HANDLER(ViewHostMsg_RemoveAutofillEntry, OnRemoveAutofillEntry) - IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFeedList, OnMsgUpdateFeedList) IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRequest, OnExtensionRequest) IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnMsgSelectionChanged) IPC_MESSAGE_HANDLER(ViewHostMsg_PasteFromSelectionClipboard, @@ -920,11 +919,6 @@ void RenderViewHost::OnMsgUpdateTitle(int32 page_id, delegate_->UpdateTitle(this, page_id, title); } -void RenderViewHost::OnMsgUpdateFeedList( - const ViewHostMsg_UpdateFeedList_Params& params) { - delegate_->UpdateFeedList(this, params); -} - void RenderViewHost::OnMsgUpdateEncoding(const std::wstring& encoding_name) { delegate_->UpdateEncoding(this, encoding_name); } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index b43e3ce..d0eed0b 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -507,7 +507,6 @@ class RenderViewHost : public RenderWidgetHost { void OnUpdateDragCursor(bool is_drop_target); void OnTakeFocus(bool reverse); void OnMsgPageHasOSDD(int32 page_id, const GURL& doc_url, bool autodetected); - void OnMsgUpdateFeedList(const ViewHostMsg_UpdateFeedList_Params& params); void OnMsgInspectElementReply(int num_resources); void DidPrintPage(const ViewHostMsg_DidPrintPage_Params& params); void OnDebugMessage(const std::string& message); diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index a52196e..14a1da0 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -14,7 +14,6 @@ #include "base/logging.h" #include "chrome/common/native_web_keyboard_event.h" #include "net/base/load_states.h" -#include "webkit/glue/feed.h" #include "webkit/glue/password_form.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/window_open_disposition.h" @@ -34,7 +33,6 @@ struct ThumbnailScore; struct ContextMenuParams; struct ViewHostMsg_DidPrintPage_Params; struct ViewHostMsg_FrameNavigate_Params; -struct ViewHostMsg_UpdateFeedList_Params; struct WebDropData; namespace base { @@ -186,11 +184,6 @@ class RenderViewHostDelegate { int32 page_id, const std::wstring& title) { } - // The list of feeds have been updated. - virtual void UpdateFeedList( - RenderViewHost* render_view_host, - const ViewHostMsg_UpdateFeedList_Params& params) { } - // The page's encoding was changed and should be updated. virtual void UpdateEncoding(RenderViewHost* render_view_host, const std::wstring& encoding) { } diff --git a/chrome/browser/tab_contents/navigation_entry.h b/chrome/browser/tab_contents/navigation_entry.h index 964a724..fb8a225 100644 --- a/chrome/browser/tab_contents/navigation_entry.h +++ b/chrome/browser/tab_contents/navigation_entry.h @@ -14,7 +14,6 @@ #include "googleurl/src/gurl.h" #include "grit/theme_resources.h" #include "skia/include/SkBitmap.h" -#include "webkit/glue/feed.h" class NavigationController; @@ -323,14 +322,6 @@ 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 @@ -400,7 +391,6 @@ 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.cc b/chrome/browser/tab_contents/tab_contents.cc index 035203e..72ee5602 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -1725,25 +1725,6 @@ void TabContents::UpdateTitle(RenderViewHost* rvh, NotifyNavigationStateChanged(INVALIDATE_TITLE); } -void TabContents::UpdateFeedList( - RenderViewHost* rvh, const ViewHostMsg_UpdateFeedList_Params& params) { - // We might have an old RenderViewHost sending messages, and we should ignore - // those messages. - if (rvh != render_view_host()) - return; - - NavigationEntry* entry = controller_.GetEntryWithPageID(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 TabContents::UpdateEncoding(RenderViewHost* render_view_host, const std::wstring& encoding) { set_encoding(encoding); diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index eadc025..0497fdd 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -92,12 +92,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_FEEDLIST = 16, // The Atom/RSS feed has changed. - INVALIDATE_PAGE_ACTIONS = 32, // Page action icons have 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_PAGE_ACTIONS = 16, // Page action icons have changed. // Helper for forcing a refresh. INVALIDATE_EVERYTHING = 0xFFFFFFFF }; @@ -735,8 +734,6 @@ class TabContents : public PageNavigator, 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); diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc index 3dc574a..4f9c98e 100644 --- a/chrome/browser/toolbar_model.cc +++ b/chrome/browser/toolbar_model.cc @@ -15,8 +15,6 @@ #include "chrome/common/pref_service.h" #include "grit/generated_resources.h" #include "net/base/net_util.h" -#include "webkit/glue/feed.h" - ToolbarModel::ToolbarModel() : input_in_progress_(false) { } @@ -108,21 +106,6 @@ ToolbarModel::Icon ToolbarModel::GetIcon() { } } -scoped_refptr<FeedList> ToolbarModel::GetFeedList() { - if (input_in_progress_) - return NULL; - - NavigationController* navigation_controller = GetNavigationController(); - if (!navigation_controller) // We might not have a controller on init. - return NULL; - - NavigationEntry* entry = navigation_controller->GetActiveEntry(); - if (!entry) - return NULL; - - return entry->feedlist(); -} - void ToolbarModel::GetIconHoverText(std::wstring* text, SkColor* text_color) { static const SkColor kOKHttpsInfoBubbleTextColor = SkColorSetRGB(0, 153, 51); // Green. diff --git a/chrome/browser/toolbar_model.h b/chrome/browser/toolbar_model.h index 3a6dff7..daf3cea 100644 --- a/chrome/browser/toolbar_model.h +++ b/chrome/browser/toolbar_model.h @@ -9,7 +9,6 @@ #include "base/basictypes.h" #include "skia/include/SkColor.h" -#include "webkit/glue/feed.h" class NavigationController; class NavigationEntry; @@ -53,9 +52,6 @@ class ToolbarModel { // Default value: NO_ICON. virtual Icon GetIcon(); - // Returns an array of available feeds. - virtual scoped_refptr<FeedList> GetFeedList(); - // Sets the text and color of the text displayed in the info bubble that // appears when the user hovers the mouse over the icon. // Default value: empty string. diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index bc286f1..727eebc 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -90,7 +90,6 @@ LocationBarView::LocationBarView(Profile* profile, keyword_hint_view_(profile), type_to_search_view_(l10n_util::GetString(IDS_OMNIBOX_EMPTY_TEXT)), security_image_view_(profile, model), - rss_image_view_(model), popup_window_mode_(popup_window_mode), first_run_bubble_(this), popup_positioner_(popup_positioner) { @@ -159,10 +158,6 @@ void LocationBarView::Init() { keyword_hint_view_.SetColor(gray); keyword_hint_view_.SetParentOwned(false); - AddChildView(&rss_image_view_); - rss_image_view_.SetVisible(false); - rss_image_view_.SetParentOwned(false); - AddChildView(&security_image_view_); security_image_view_.SetVisible(false); security_image_view_.SetParentOwned(false); @@ -184,7 +179,6 @@ void LocationBarView::Init() { void LocationBarView::Update(const TabContents* tab_for_state_restoring) { SetSecurityIcon(model_->GetIcon()); - SetRssIconVisibility(model_->GetFeedList().get()); RefreshPageActionViews(); std::wstring info_text, info_tooltip; SkColor text_color; @@ -195,12 +189,6 @@ void LocationBarView::Update(const TabContents* tab_for_state_restoring) { SchedulePaint(); } -void LocationBarView::UpdateFeedIcon() { - SetRssIconVisibility(model_->GetFeedList().get()); - Layout(); - SchedulePaint(); -} - void LocationBarView::UpdatePageActions() { RefreshPageActionViews(); @@ -369,11 +357,6 @@ void LocationBarView::DoLayout(const bool force_layout) { page_action_image_views_.size(); } } - gfx::Size rss_image_size; - if (rss_image_view_.IsVisible()) { - rss_image_size = rss_image_view_.GetPreferredSize(); - entry_width -= rss_image_size.width() + kInnerPadding; - } gfx::Size security_image_size; if (security_image_view_.IsVisible()) { security_image_size = security_image_view_.GetPreferredSize(); @@ -419,15 +402,6 @@ void LocationBarView::DoLayout(const bool force_layout) { location_height); } } - if (rss_image_view_.IsVisible()) { - rss_image_view_.SetBounds(width() - kEntryPadding - - info_label_width - - security_image_size.width() - - rss_image_size.width(), - location_y, - rss_image_size.width(), - location_height); - } if (security_image_view_.IsVisible()) { security_image_view_.SetBounds(width() - kEntryPadding - info_label_width - security_image_size.width(), location_y, security_image_size.width(), @@ -559,12 +533,6 @@ void LocationBarView::SetSecurityIcon(ToolbarModel::Icon icon) { } } -void LocationBarView::SetRssIconVisibility(FeedList* feeds) { - bool show_rss = feeds && feeds->list().size() > 0; - // TODO(finnur): Enable this when we have a good landing page to show feeds. - rss_image_view_.SetVisible(false); -} - void LocationBarView::DeletePageActionViews() { if (!page_action_image_views_.empty()) { for (size_t i = 0; i < page_action_image_views_.size(); ++i) @@ -1127,51 +1095,6 @@ void LocationBarView::SecurityImageView::ShowInfoBubble() { ShowInfoBubbleImpl(text, text_color); } -// RssImageView------------------------------------------------------------ - -// static -SkBitmap* LocationBarView::RssImageView::rss_icon_ = NULL; - -LocationBarView::RssImageView::RssImageView(ToolbarModel* model) - : model_(model), - LocationBarImageView() { - if (!rss_icon_) { - ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - rss_icon_ = rb.GetBitmapNamed(IDR_RSS_ICON); - } - ImageView::SetImage(rss_icon_); -} - -LocationBarView::RssImageView::~RssImageView() { -} - -bool LocationBarView::RssImageView::OnMousePressed( - const views::MouseEvent& event) { - NavigationEntry* entry = - BrowserList::GetLastActive()->GetSelectedTabContents()-> - controller().GetActiveEntry(); - if (!entry) { - NOTREACHED(); - return true; - } - - // Navigate to the first item in the feed list. - scoped_refptr<FeedList> feeds = model_->GetFeedList(); - DCHECK(feeds.get() && feeds->list().size() > 0); - - // TODO(finnur): Make this do more than just display the XML in the browser. - BrowserList::GetLastActive()->OpenURL(feeds->list()[0].url, GURL(), - CURRENT_TAB, PageTransition::LINK); - return true; -} - -void LocationBarView::RssImageView::ShowInfoBubble() { - // TODO(finnur): Get this string from the resources. - std::wstring text = L"Subscribe to this feed"; - SkColor text_color = SK_ColorBLUE; - ShowInfoBubbleImpl(text, text_color); -} - // PageActionImageView---------------------------------------------------------- LocationBarView::PageActionImageView::PageActionImageView( @@ -1285,4 +1208,3 @@ void LocationBarView::SaveStateToContents(TabContents* contents) { void LocationBarView::Revert() { location_entry_->RevertAll(); } - diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index abc3311..456204d 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -126,7 +126,6 @@ class LocationBarView : public LocationBar, virtual void AcceptInputWithDisposition(WindowOpenDisposition); virtual void FocusLocation(); virtual void FocusSearch(); - virtual void UpdateFeedIcon(); virtual void UpdatePageActions(); virtual void SaveStateToContents(TabContents* contents); virtual void Revert(); @@ -312,30 +311,6 @@ class LocationBarView : public LocationBar, DISALLOW_COPY_AND_ASSIGN(SecurityImageView); }; - // RssImageView is used to display the RSS icon when the page has a feed that - // you can subscribe to. - // - // If a message has been set with SetInfoBubbleText, it displays an info - // bubble when the mouse hovers on the image. - class RssImageView : public LocationBarImageView { - public: - explicit RssImageView(ToolbarModel* model); - virtual ~RssImageView(); - - // Overridden from view for the mouse hovering. - virtual bool OnMousePressed(const views::MouseEvent& event); - - virtual void ShowInfoBubble(); - - private: - // The RSS icon shown when page has a feed. - static SkBitmap* rss_icon_; - - ToolbarModel* model_; - - DISALLOW_COPY_AND_ASSIGN(RssImageView); - }; - // PageActionImageView is used to display the icon for a given PageAction // and notify the extension when the icon is clicked. class PageActionImageView : public LocationBarImageView { @@ -418,9 +393,6 @@ class LocationBarView : public LocationBar, // Sets the security icon to display. Note that no repaint is done. void SetSecurityIcon(ToolbarModel::Icon icon); - // Sets the RSS icon visibility. - void SetRssIconVisibility(FeedList* feeds); - // Delete all page action views that we have created. void DeletePageActionViews(); @@ -497,9 +469,6 @@ class LocationBarView : public LocationBar, // The view that shows the lock/warning when in HTTPS mode. SecurityImageView security_image_view_; - // The view that shows the RSS icon when the page has an RSS feed. - RssImageView rss_image_view_; - // The page action icon views. std::vector<PageActionImageView*> page_action_image_views_; |