Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
index 584cd68ead20be1866416c0c87a0a0bc9f0ce238..d1bdff091ad7a99c93db3c702440f3bc5e6f126d 100644 |
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
@@ -407,7 +407,7 @@ void LocationBarView::ModeChanged(const chrome::search::Mode& old_mode, |
void LocationBarView::Update(const WebContents* tab_for_state_restoring) { |
RefreshContentSettingViews(); |
ZoomBubbleView::CloseBubble(); |
- zoom_view_->Update(); |
+ RefreshZoomView(); |
RefreshPageActionViews(); |
bool star_enabled = star_view_ && !model_->input_in_progress() && |
@@ -519,20 +519,23 @@ void LocationBarView::ShowStarBubble(const GURL& url, bool newly_bookmarked) { |
chrome::ShowBookmarkBubbleView(star_view_, profile_, url, newly_bookmarked); |
} |
-void LocationBarView::SetZoomIconTooltipPercent(int zoom_percent) { |
- zoom_view_->SetZoomIconTooltipPercent(zoom_percent); |
-} |
- |
-void LocationBarView::SetZoomIconState( |
- ZoomController::ZoomIconState zoom_icon_state) { |
- zoom_view_->SetZoomIconState(zoom_icon_state); |
+void LocationBarView::ZoomChangedForActiveTab(bool can_show_bubble) { |
+ DCHECK(zoom_view_); |
+ RefreshZoomView(); |
Layout(); |
SchedulePaint(); |
+ |
+ // TODO(dbeam): don't show a bubble when the wrench menu is showing. |
+ if (can_show_bubble && zoom_view_->visible()) |
+ ZoomBubbleView::ShowBubble(zoom_view_, GetTabContents(), true); |
} |
-void LocationBarView::ShowZoomBubble(int zoom_percent) { |
- ZoomBubbleView::ShowBubble(zoom_view_, GetTabContents(), true); |
+void LocationBarView::RefreshZoomView() { |
+ DCHECK(zoom_view_); |
+ TabContents* tab_contents = GetTabContents(); |
+ if (tab_contents) |
+ zoom_view_->Update(tab_contents->zoom_controller()); |
} |
void LocationBarView::ShowChromeToMobileBubble() { |