| Index: chrome/browser/views/location_bar_view.cc
|
| diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
|
| index 324cf6006a6da4b334f94604b5ff8bf23e14ead5..437862f2ff9cbbeac407a1f378d4e1552b613ecd 100644
|
| --- a/chrome/browser/views/location_bar_view.cc
|
| +++ b/chrome/browser/views/location_bar_view.cc
|
| @@ -1245,19 +1245,24 @@ void LocationBarView::PageActionImageView::UpdateVisibility(
|
|
|
| const ExtensionActionState* state =
|
| contents->GetPageActionState(page_action_);
|
| - bool visible = state != NULL;
|
| + bool visible = state && !state->hidden();
|
| if (visible) {
|
| // Set the tooltip.
|
| if (state->title().empty())
|
| tooltip_ = page_action_->title();
|
| else
|
| tooltip_ = state->title();
|
| +
|
| // Set the image.
|
| - int index = state->icon_index();
|
| - // The image index (if not within bounds) will be set to the first image.
|
| - if (index < 0 || index >= static_cast<int>(page_action_icons_.size()))
|
| - index = 0;
|
| - ImageView::SetImage(page_action_icons_[index]);
|
| + SkBitmap* icon = state->icon();
|
| + if (!icon) {
|
| + int index = state->icon_index();
|
| + // The image index (if not within bounds) will be set to the first image.
|
| + if (index < 0 || index >= static_cast<int>(page_action_icons_.size()))
|
| + index = 0;
|
| + icon = &page_action_icons_[index];
|
| + }
|
| + ImageView::SetImage(icon);
|
| }
|
| SetVisible(visible);
|
| }
|
|
|