Chromium Code Reviews| 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 e18b1183ad24c99b1cd562e194c0d77a7bfe3484..d3113c63475a573e7c72aedc13112af713bee153 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -398,7 +398,8 @@ void LocationBarView::ModeChanged(const chrome::search::Mode& old_mode, |
| void LocationBarView::Update(const WebContents* tab_for_state_restoring) { |
| RefreshContentSettingViews(); |
| - zoom_view_->Update(); |
| + ZoomBubbleView::CloseBubble(); |
| + RefreshZoomView(); |
| RefreshPageActionViews(); |
| bool star_enabled = star_view_ && !model_->input_in_progress() && |
| @@ -506,20 +507,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) { |
| + RefreshZoomView(); |
| Layout(); |
| SchedulePaint(); |
| + |
| + // TODO(dbeam): don't show a bubble when the wrench menu is showing. |
| + if (can_show_bubble && zoom_view_ && zoom_view_->visible()) |
|
Peter Kasting
2012/08/16 04:04:48
Nit: You don't need to check |zoom_view_| unless t
Dan Beam
2012/08/16 06:52:29
Changed these to DCHECK()s instead as you're right
|
| + ZoomBubbleView::ShowBubble(zoom_view_, GetTabContents(), true); |
| } |
| -void LocationBarView::ShowZoomBubble(int zoom_percent) { |
| - ZoomBubbleView::ShowBubble(zoom_view_, GetTabContents(), true); |
| +void LocationBarView::RefreshZoomView() { |
| + TabContents* tab_contents = GetTabContents(); |
| + if (!zoom_view_ || !tab_contents) |
|
Peter Kasting
2012/08/16 04:04:48
Nit: Shorter:
zoom_view_->Update(GetTabContents
Dan Beam
2012/08/16 06:52:29
I think khorimoto@ mentioned that the browser gets
|
| + return; |
| + |
| + zoom_view_->Update(tab_contents->zoom_controller()); |
| } |
| void LocationBarView::ShowChromeToMobileBubble() { |