diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 04:44:34 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 04:44:34 +0000 |
commit | ed65cb7e5d34492dfb1208a90e155602fc35f8b2 (patch) | |
tree | d62f0b0057c30b027d4c0a314a405f427d82a5c8 /chrome/browser/gtk/location_bar_view_gtk.cc | |
parent | dd03033d9669dbad7e6ac3cfaa220593c0534a2d (diff) | |
download | chromium_src-ed65cb7e5d34492dfb1208a90e155602fc35f8b2.zip chromium_src-ed65cb7e5d34492dfb1208a90e155602fc35f8b2.tar.gz chromium_src-ed65cb7e5d34492dfb1208a90e155602fc35f8b2.tar.bz2 |
Readding from scratch instead reverting the revert.
It kept eating the files I added, so I recreated
the changelist from scratch using the raw patch
downloaded from Rietveld.
TBR=mpcomplete
Original description:
We changed the page action manifest from
'icon' -> 'default_icon'
and now allow extensions to programmatically
specifying an icon. However, page actions that
hard-coded an icon using the 'icon' tag in the
manifest (don't show an icon programmatically)
now lose their icons. This causes a crash when we
try to display the icon in the LocationBarView.
We now check when the extension tries to enable
the page action whether there are any icons to
display. If not, we don't proceed and log an
error to the console.
BUG=25562
TEST=Covered by browser test.
Review URL: http://codereview.chromium.org/334005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/location_bar_view_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/location_bar_view_gtk.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc index 8648099..382563a 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/gtk/location_bar_view_gtk.cc @@ -409,6 +409,15 @@ void LocationBarViewGtk::UpdatePageActions() { if (profile_->GetExtensionsService()) page_actions = profile_->GetExtensionsService()->GetPageActions(); + // Page actions can be created without an icon, so make sure we count only + // those that have been given an icon. + for (size_t i = 0; i < page_actions.size();) { + if (page_actions[i]->icon_paths().empty()) + page_actions.erase(page_actions.begin() + i); + else + ++i; + } + // Initialize on the first call, or re-inialize if more extensions have been // loaded or added after startup. if (page_actions.size() != page_action_views_.size()) { |