Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: chrome/browser/ui/gtk/browser_toolbar_gtk.cc

Issue 11866004: Add scheme to HostZoomMap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add namespace Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_toolbar_gtk.h ('k') | chrome/browser/ui/gtk/location_bar_view_gtk_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698