Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2864)

Unified Diff: chrome/browser/gtk/location_bar_view_gtk.cc

Issue 316018: Fix crash with page actions without icons (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/gtk/location_bar_view_gtk.cc
===================================================================
--- chrome/browser/gtk/location_bar_view_gtk.cc (revision 29714)
+++ chrome/browser/gtk/location_bar_view_gtk.cc (working copy)
@@ -409,6 +409,15 @@
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()) {
« no previous file with comments | « chrome/browser/extensions/extension_page_actions_module.cc ('k') | chrome/browser/views/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698