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/gtk/browser_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <X11/XF86keysym.h> | 9 #include <X11/XF86keysym.h> |
10 | 10 |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 if (actions_toolbar_.get()) | 435 if (actions_toolbar_.get()) |
436 actions_toolbar_->Update(); | 436 actions_toolbar_->Update(); |
437 } | 437 } |
438 | 438 |
439 bool BrowserToolbarGtk::IsWrenchMenuShowing() const { | 439 bool BrowserToolbarGtk::IsWrenchMenuShowing() const { |
440 return wrench_menu_.get() && gtk_widget_get_visible(wrench_menu_->widget()); | 440 return wrench_menu_.get() && gtk_widget_get_visible(wrench_menu_->widget()); |
441 } | 441 } |
442 | 442 |
443 // BrowserToolbarGtk, private -------------------------------------------------- | 443 // BrowserToolbarGtk, private -------------------------------------------------- |
444 | 444 |
445 void BrowserToolbarGtk::OnZoomLevelChanged(const std::string& host) { | 445 void BrowserToolbarGtk::OnZoomLevelChanged( |
| 446 const HostZoomMap::ZoomLevelChange& change) { |
446 // Since BrowserToolbarGtk create a new |wrench_menu_model_| in | 447 // Since BrowserToolbarGtk create a new |wrench_menu_model_| in |
447 // RebuildWrenchMenu(), the ordering of the observers of HostZoomMap | 448 // RebuildWrenchMenu(), the ordering of the observers of HostZoomMap |
448 // can change, and result in subtle bugs like http://crbug.com/118823. | 449 // can change, and result in subtle bugs like http://crbug.com/118823. |
449 // Rather than depending on the ordering of the observers, always update | 450 // Rather than depending on the ordering of the observers, always update |
450 // the WrenchMenuModel before updating the WrenchMenu. | 451 // the WrenchMenuModel before updating the WrenchMenu. |
451 wrench_menu_model_->UpdateZoomControls(); | 452 wrench_menu_model_->UpdateZoomControls(); |
452 | 453 |
453 // If our zoom level changed, we need to tell the menu to update its state, | 454 // If our zoom level changed, we need to tell the menu to update its state, |
454 // since the menu could still be open. | 455 // since the menu could still be open. |
455 wrench_menu_->UpdateMenu(); | 456 wrench_menu_->UpdateMenu(); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 allocation.x + x_offset, | 705 allocation.x + x_offset, |
705 allocation.y + y_offset); | 706 allocation.y + y_offset); |
706 | 707 |
707 return FALSE; | 708 return FALSE; |
708 } | 709 } |
709 | 710 |
710 void BrowserToolbarGtk::UpdateShowHomeButton() { | 711 void BrowserToolbarGtk::UpdateShowHomeButton() { |
711 bool visible = show_home_button_.GetValue() && !ShouldOnlyShowLocation(); | 712 bool visible = show_home_button_.GetValue() && !ShouldOnlyShowLocation(); |
712 gtk_widget_set_visible(home_->widget(), visible); | 713 gtk_widget_set_visible(home_->widget(), visible); |
713 } | 714 } |
OLD | NEW |