| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/browser_toolbar_gtk.h" | 5 #include "chrome/browser/gtk/browser_toolbar_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
| 9 | 9 |
| 10 #include "app/gfx/gtk_util.h" | 10 #include "app/gfx/gtk_util.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 if (profile == profile_) | 399 if (profile == profile_) |
| 400 return; | 400 return; |
| 401 | 401 |
| 402 profile_ = profile; | 402 profile_ = profile; |
| 403 location_bar_->SetProfile(profile); | 403 location_bar_->SetProfile(profile); |
| 404 } | 404 } |
| 405 | 405 |
| 406 void BrowserToolbarGtk::UpdateTabContents(TabContents* contents, | 406 void BrowserToolbarGtk::UpdateTabContents(TabContents* contents, |
| 407 bool should_restore_state) { | 407 bool should_restore_state) { |
| 408 location_bar_->Update(should_restore_state ? contents : NULL); | 408 location_bar_->Update(should_restore_state ? contents : NULL); |
| 409 |
| 410 if (actions_toolbar_.get()) |
| 411 actions_toolbar_->Update(); |
| 409 } | 412 } |
| 410 | 413 |
| 411 gfx::Rect BrowserToolbarGtk::GetLocationStackBounds() const { | 414 gfx::Rect BrowserToolbarGtk::GetLocationStackBounds() const { |
| 412 // The number of pixels from the left or right edges of the location stack to | 415 // The number of pixels from the left or right edges of the location stack to |
| 413 // "just inside the visible borders". When the omnibox bubble contents are | 416 // "just inside the visible borders". When the omnibox bubble contents are |
| 414 // aligned with this, the visible borders tacked on to the outsides will line | 417 // aligned with this, the visible borders tacked on to the outsides will line |
| 415 // up with the visible borders on the location stack. | 418 // up with the visible borders on the location stack. |
| 416 const int kLocationStackEdgeWidth = 1; | 419 const int kLocationStackEdgeWidth = 1; |
| 417 | 420 |
| 418 GtkWidget* left; | 421 GtkWidget* left; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 menu->PopupAsFromKeyEvent(button); | 690 menu->PopupAsFromKeyEvent(button); |
| 688 menu_bar_helper_.MenuStartedShowing(button, menu->widget()); | 691 menu_bar_helper_.MenuStartedShowing(button, menu->widget()); |
| 689 } | 692 } |
| 690 | 693 |
| 691 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button, | 694 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button, |
| 692 GtkMenuDirectionType dir) { | 695 GtkMenuDirectionType dir) { |
| 693 GtkWidget* other_button = button == page_menu_button_.get() ? | 696 GtkWidget* other_button = button == page_menu_button_.get() ? |
| 694 app_menu_button_.get() : page_menu_button_.get(); | 697 app_menu_button_.get() : page_menu_button_.get(); |
| 695 PopupForButton(other_button); | 698 PopupForButton(other_button); |
| 696 } | 699 } |
| OLD | NEW |