summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/location_bar_view.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 21:30:53 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 21:30:53 +0000
commit361b28a80cfd2a9a0db454c7ebdb9c95ea55840c (patch)
treea6cf253e64ded952e1a5518f8d25ac8848c6200b /chrome/browser/views/location_bar_view.cc
parent76b118a0f798a2e88103492173225e57b2062a37 (diff)
downloadchromium_src-361b28a80cfd2a9a0db454c7ebdb9c95ea55840c.zip
chromium_src-361b28a80cfd2a9a0db454c7ebdb9c95ea55840c.tar.gz
chromium_src-361b28a80cfd2a9a0db454c7ebdb9c95ea55840c.tar.bz2
Add a rudamentary feed preview to the RSS extension. It
doesn't handle inline HTML in the item description (it just dumps it as text) and the feed needs to be valid XML for it to show any preview, but it is better than nothing. We can easily change it to display the HTML but we want to (at some point) try to use a separate origin so that we can render the HTML code from untrusted sources safely. Also fix a bug in the image tracker. It should not try to communicate with the view if the view has gone away (which was the whole point of the image tracker...) BUG=None TEST=Install the extension, browse to a page with a feed and click onthe rss icon in the Omnibox. An interstitial page should appear with a preview of the feed. Review URL: http://codereview.chromium.org/155180 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/location_bar_view.cc')
-rw-r--r--chrome/browser/views/location_bar_view.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
index af8c57f..eb6d629 100644
--- a/chrome/browser/views/location_bar_view.cc
+++ b/chrome/browser/views/location_bar_view.cc
@@ -1153,7 +1153,8 @@ class LocationBarView::PageActionImageView::ImageLoadingTracker
}
void OnImageLoaded(SkBitmap* image, int index) {
- view_->OnImageLoaded(image, index);
+ if (view_)
+ view_->OnImageLoaded(image, index);
delete image;
if (--image_count_ == 0)
Release(); // We are no longer needed.
@@ -1366,3 +1367,12 @@ void LocationBarView::SaveStateToContents(TabContents* contents) {
void LocationBarView::Revert() {
location_entry_->RevertAll();
}
+
+int LocationBarView::PageActionVisibleCount() {
+ int result = 0;
+ for (size_t i = 0; i < page_action_image_views_.size(); i++) {
+ if (page_action_image_views_[i]->IsVisible())
+ ++result;
+ }
+ return result;
+}