| Index: chrome/browser/ui/zoom/zoom_controller.cc
|
| diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc
|
| index b828b3b09dfafa02bb64e5633527dc6c86761a72..7f09d1bbfe047ba13843dbb8b6078a17c0a1786a 100644
|
| --- a/chrome/browser/ui/zoom/zoom_controller.cc
|
| +++ b/chrome/browser/ui/zoom/zoom_controller.cc
|
| @@ -17,7 +17,6 @@
|
|
|
| ZoomController::ZoomController(TabContents* tab_contents)
|
| : content::WebContentsObserver(tab_contents->web_contents()),
|
| - zoom_icon_state_(NONE),
|
| zoom_percent_(100),
|
| tab_contents_(tab_contents),
|
| observer_(NULL) {
|
| @@ -34,6 +33,11 @@ ZoomController::~ZoomController() {
|
| registrar_.RemoveAll();
|
| }
|
|
|
| +bool ZoomController::IsAtDefaultZoom() const {
|
| + return content::ZoomValuesEqual(tab_contents_->web_contents()->GetZoomLevel(),
|
| + default_zoom_level_.GetValue());
|
| +}
|
| +
|
| void ZoomController::DidNavigateMainFrame(
|
| const content::LoadCommittedDetails& details,
|
| const content::FrameNavigateParams& params) {
|
| @@ -61,32 +65,9 @@ void ZoomController::Observe(int type,
|
| }
|
|
|
| void ZoomController::UpdateState(bool can_show_bubble) {
|
| - double current_zoom_level = tab_contents_->web_contents()->GetZoomLevel();
|
| - double default_zoom_level = default_zoom_level_.GetValue();
|
| -
|
| - ZoomIconState state;
|
| - if (content::ZoomValuesEqual(current_zoom_level, default_zoom_level))
|
| - state = NONE;
|
| - else if (current_zoom_level > default_zoom_level)
|
| - state = ZOOM_PLUS_ICON;
|
| - else
|
| - state = ZOOM_MINUS_ICON;
|
| -
|
| bool dummy;
|
| - int zoom_percent = tab_contents_->web_contents()->
|
| - GetZoomPercent(&dummy, &dummy);
|
| + zoom_percent_ = tab_contents_->web_contents()->GetZoomPercent(&dummy, &dummy);
|
|
|
| - if (state != zoom_icon_state_) {
|
| - zoom_icon_state_ = state;
|
| - if (observer_)
|
| - observer_->OnZoomIconChanged(tab_contents_, state);
|
| - }
|
| -
|
| - if (zoom_percent != zoom_percent_) {
|
| - zoom_percent_ = zoom_percent;
|
| - if (observer_)
|
| - observer_->OnZoomChanged(tab_contents_,
|
| - zoom_percent,
|
| - can_show_bubble && state != NONE);
|
| - }
|
| + if (observer_)
|
| + observer_->OnZoomChanged(tab_contents_, can_show_bubble);
|
| }
|
|
|