| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include <X11/XF86keysym.h> | 9 #include <X11/XF86keysym.h> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // The color used as the base[] color of the location entry during a secure | 71 // The color used as the base[] color of the location entry during a secure |
| 72 // connection. | 72 // connection. |
| 73 const GdkColor kSecureColor = GDK_COLOR_RGB(255, 245, 195); | 73 const GdkColor kSecureColor = GDK_COLOR_RGB(255, 245, 195); |
| 74 | 74 |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 // BrowserToolbarGtk, public --------------------------------------------------- | 77 // BrowserToolbarGtk, public --------------------------------------------------- |
| 78 | 78 |
| 79 BrowserToolbarGtk::BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window) | 79 BrowserToolbarGtk::BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window) |
| 80 : toolbar_(NULL), | 80 : toolbar_(NULL), |
| 81 location_bar_(new LocationBarViewGtk(browser->command_updater(), | 81 location_bar_(new LocationBarViewGtk(this, browser)), |
| 82 browser->toolbar_model(), | |
| 83 this, | |
| 84 browser)), | |
| 85 model_(browser->toolbar_model()), | 82 model_(browser->toolbar_model()), |
| 86 page_menu_model_(this, browser), | 83 page_menu_model_(this, browser), |
| 87 app_menu_model_(this, browser), | 84 app_menu_model_(this, browser), |
| 88 browser_(browser), | 85 browser_(browser), |
| 89 window_(window), | 86 window_(window), |
| 90 profile_(NULL), | 87 profile_(NULL), |
| 91 sync_service_(NULL), | 88 sync_service_(NULL), |
| 92 menu_bar_helper_(this) { | 89 menu_bar_helper_(this) { |
| 93 browser_->command_updater()->AddCommandObserver(IDC_BACK, this); | 90 browser_->command_updater()->AddCommandObserver(IDC_BACK, this); |
| 94 browser_->command_updater()->AddCommandObserver(IDC_FORWARD, this); | 91 browser_->command_updater()->AddCommandObserver(IDC_FORWARD, this); |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 menu->PopupAsFromKeyEvent(button); | 716 menu->PopupAsFromKeyEvent(button); |
| 720 menu_bar_helper_.MenuStartedShowing(button, menu->widget()); | 717 menu_bar_helper_.MenuStartedShowing(button, menu->widget()); |
| 721 } | 718 } |
| 722 | 719 |
| 723 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button, | 720 void BrowserToolbarGtk::PopupForButtonNextTo(GtkWidget* button, |
| 724 GtkMenuDirectionType dir) { | 721 GtkMenuDirectionType dir) { |
| 725 GtkWidget* other_button = button == page_menu_button_.get() ? | 722 GtkWidget* other_button = button == page_menu_button_.get() ? |
| 726 app_menu_button_.get() : page_menu_button_.get(); | 723 app_menu_button_.get() : page_menu_button_.get(); |
| 727 PopupForButton(other_button); | 724 PopupForButton(other_button); |
| 728 } | 725 } |
| OLD | NEW |