| Index: chrome/browser/ui/gtk/browser_titlebar.cc
|
| diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc
|
| index a1b3ed2465c91359b6b18dfef1356ecdf6122aaa..f23d15e815290176b67bfb60356c9c440eca0cfb 100644
|
| --- a/chrome/browser/ui/gtk/browser_titlebar.cc
|
| +++ b/chrome/browser/ui/gtk/browser_titlebar.cc
|
| @@ -383,16 +383,6 @@ void BrowserTitlebar::Init() {
|
| reinterpret_cast<void*>(true));
|
| gtk_container_add(GTK_CONTAINER(favicon_event_box), app_mode_favicon_);
|
|
|
| - if (IsTypePanel()) {
|
| - panel_wrench_button_.reset(
|
| - BuildTitlebarButton(IDR_BALLOON_WRENCH, IDR_BALLOON_WRENCH_P,
|
| - IDR_BALLOON_WRENCH_H, app_mode_hbox, FALSE,
|
| - IDS_PANEL_WINDOW_SETTINGS_BUTTON_TOOLTIP));
|
| - g_signal_connect(panel_wrench_button_->widget(), "button-press-event",
|
| - G_CALLBACK(OnPanelSettingsMenuButtonPressedThunk), this);
|
| - gtk_widget_set_no_show_all(panel_wrench_button_->widget(), TRUE);
|
| - }
|
| -
|
| app_mode_title_ = gtk_label_new(NULL);
|
| gtk_label_set_ellipsize(GTK_LABEL(app_mode_title_), PANGO_ELLIPSIZE_END);
|
| gtk_misc_set_alignment(GTK_MISC(app_mode_title_), 0.0, 0.5);
|
| @@ -925,15 +915,6 @@ gboolean BrowserTitlebar::OnFaviconMenuButtonPressed(GtkWidget* widget,
|
| return TRUE;
|
| }
|
|
|
| -gboolean BrowserTitlebar::OnPanelSettingsMenuButtonPressed(
|
| - GtkWidget* widget, GdkEventButton* event) {
|
| - if (event->button != 1)
|
| - return FALSE;
|
| -
|
| - browser_window_->ShowSettingsMenu(widget, event);
|
| - return TRUE;
|
| -}
|
| -
|
| void BrowserTitlebar::ShowContextMenu(GdkEventButton* event) {
|
| if (!context_menu_.get()) {
|
| context_menu_model_.reset(new ContextMenuModel(this));
|
| @@ -944,43 +925,43 @@ void BrowserTitlebar::ShowContextMenu(GdkEventButton* event) {
|
| event->time);
|
| }
|
|
|
| -void BrowserTitlebar::SendEnterNotifyToCloseButtonIfUnderMouse() {
|
| - gint x;
|
| - gint y;
|
| - GtkAllocation widget_allocation = close_button_->WidgetAllocation();
|
| - gtk_widget_get_pointer(GTK_WIDGET(close_button_->widget()), &x, &y);
|
| -
|
| - gfx::Rect button_rect(0, 0, widget_allocation.width,
|
| - widget_allocation.height);
|
| - if (!button_rect.Contains(x, y)) {
|
| - // Mouse is not over the close button.
|
| - return;
|
| - }
|
| -
|
| - // Create and emit an enter-notify-event on close button.
|
| - GValue return_value;
|
| - return_value.g_type = G_TYPE_BOOLEAN;
|
| - g_value_set_boolean(&return_value, false);
|
| -
|
| - GdkEvent* event = gdk_event_new(GDK_ENTER_NOTIFY);
|
| - event->crossing.window =
|
| - gtk_button_get_event_window(GTK_BUTTON(close_button_->widget()));
|
| - event->crossing.send_event = FALSE;
|
| - event->crossing.subwindow = gtk_widget_get_window(close_button_->widget());
|
| - event->crossing.time = gtk_util::XTimeNow();
|
| - event->crossing.x = x;
|
| - event->crossing.y = y;
|
| - event->crossing.x_root = widget_allocation.x;
|
| - event->crossing.y_root = widget_allocation.y;
|
| - event->crossing.mode = GDK_CROSSING_NORMAL;
|
| - event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
| - event->crossing.focus = true;
|
| - event->crossing.state = 0;
|
| -
|
| - g_signal_emit_by_name(GTK_OBJECT(close_button_->widget()),
|
| - "enter-notify-event", event,
|
| - &return_value);
|
| -}
|
| +void BrowserTitlebar::SendEnterNotifyToCloseButtonIfUnderMouse() {
|
| + gint x;
|
| + gint y;
|
| + GtkAllocation widget_allocation = close_button_->WidgetAllocation();
|
| + gtk_widget_get_pointer(GTK_WIDGET(close_button_->widget()), &x, &y);
|
| +
|
| + gfx::Rect button_rect(0, 0, widget_allocation.width,
|
| + widget_allocation.height);
|
| + if (!button_rect.Contains(x, y)) {
|
| + // Mouse is not over the close button.
|
| + return;
|
| + }
|
| +
|
| + // Create and emit an enter-notify-event on close button.
|
| + GValue return_value;
|
| + return_value.g_type = G_TYPE_BOOLEAN;
|
| + g_value_set_boolean(&return_value, false);
|
| +
|
| + GdkEvent* event = gdk_event_new(GDK_ENTER_NOTIFY);
|
| + event->crossing.window =
|
| + gtk_button_get_event_window(GTK_BUTTON(close_button_->widget()));
|
| + event->crossing.send_event = FALSE;
|
| + event->crossing.subwindow = gtk_widget_get_window(close_button_->widget());
|
| + event->crossing.time = gtk_util::XTimeNow();
|
| + event->crossing.x = x;
|
| + event->crossing.y = y;
|
| + event->crossing.x_root = widget_allocation.x;
|
| + event->crossing.y_root = widget_allocation.y;
|
| + event->crossing.mode = GDK_CROSSING_NORMAL;
|
| + event->crossing.detail = GDK_NOTIFY_ANCESTOR;
|
| + event->crossing.focus = true;
|
| + event->crossing.state = 0;
|
| +
|
| + g_signal_emit_by_name(GTK_OBJECT(close_button_->widget()),
|
| + "enter-notify-event", event,
|
| + &return_value);
|
| +}
|
|
|
| int BrowserTitlebar::IconOnlyWidth() {
|
| GtkAllocation allocation;
|
| @@ -988,16 +969,6 @@ int BrowserTitlebar::IconOnlyWidth() {
|
| return 2 * kFrameBorderThickness + allocation.width;
|
| }
|
|
|
| -void BrowserTitlebar::ShowPanelWrenchButton() {
|
| - if (panel_wrench_button_.get())
|
| - gtk_widget_show(panel_wrench_button_->widget());
|
| -}
|
| -
|
| -void BrowserTitlebar::HidePanelWrenchButton() {
|
| - if (panel_wrench_button_.get())
|
| - gtk_widget_hide(panel_wrench_button_->widget());
|
| -}
|
| -
|
| bool BrowserTitlebar::IsCommandIdEnabled(int command_id) const {
|
| if (command_id == kShowWindowDecorationsCommand)
|
| return true;
|
|
|