| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/location_bar/zoom_view.h" | 5 #include "chrome/browser/ui/views/location_bar/zoom_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 7 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 8 #include "chrome/browser/ui/view_ids.h" | 8 #include "chrome/browser/ui/view_ids.h" |
| 9 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 9 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
| 10 #include "chrome/browser/ui/zoom/zoom_controller.h" | 10 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 set_accessibility_focusable(true); | 23 set_accessibility_focusable(true); |
| 24 Update(NULL); | 24 Update(NULL); |
| 25 TouchableLocationBarView::Init(this); | 25 TouchableLocationBarView::Init(this); |
| 26 } | 26 } |
| 27 | 27 |
| 28 ZoomView::~ZoomView() { | 28 ZoomView::~ZoomView() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 void ZoomView::Update(ZoomController* zoom_controller) { | 31 void ZoomView::Update(ZoomController* zoom_controller) { |
| 32 if (!zoom_controller || zoom_controller->IsAtDefaultZoom() || | 32 if (!zoom_controller || zoom_controller->IsAtDefaultZoom() || |
| 33 toolbar_model_->input_in_progress()) { | 33 toolbar_model_->GetInputInProgress()) { |
| 34 SetVisible(false); | 34 SetVisible(false); |
| 35 ZoomBubbleView::CloseBubble(); | 35 ZoomBubbleView::CloseBubble(); |
| 36 return; | 36 return; |
| 37 } | 37 } |
| 38 | 38 |
| 39 SetTooltipText(l10n_util::GetStringFUTF16Int(IDS_TOOLTIP_ZOOM, | 39 SetTooltipText(l10n_util::GetStringFUTF16Int(IDS_TOOLTIP_ZOOM, |
| 40 zoom_controller->zoom_percent())); | 40 zoom_controller->zoom_percent())); |
| 41 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 41 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 42 zoom_controller->GetResourceForZoomLevel())); | 42 zoom_controller->GetResourceForZoomLevel())); |
| 43 SetVisible(true); | 43 SetVisible(true); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 int ZoomView::GetBuiltInHorizontalPadding() const { | 84 int ZoomView::GetBuiltInHorizontalPadding() const { |
| 85 return GetBuiltInHorizontalPaddingImpl(); | 85 return GetBuiltInHorizontalPaddingImpl(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ZoomView::ActivateBubble() { | 88 void ZoomView::ActivateBubble() { |
| 89 ZoomBubbleView::ShowBubble( | 89 ZoomBubbleView::ShowBubble( |
| 90 this, location_bar_delegate_->GetTabContents(), false); | 90 this, location_bar_delegate_->GetTabContents(), false); |
| 91 } | 91 } |
| OLD | NEW |