| 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/tabs/tab_strip_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gfx/canvas_paint.h" | 9 #include "app/gfx/canvas_paint.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) { | 1564 void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) { |
| 1565 gfx::Rect bds = bounds; | 1565 gfx::Rect bds = bounds; |
| 1566 bds.set_x(gtk_util::MirroredLeftPointForRect(tabstrip_.get(), bounds)); | 1566 bds.set_x(gtk_util::MirroredLeftPointForRect(tabstrip_.get(), bounds)); |
| 1567 tab->SetBounds(bds); | 1567 tab->SetBounds(bds); |
| 1568 gtk_fixed_move(GTK_FIXED(tabstrip_.get()), tab->widget(), | 1568 gtk_fixed_move(GTK_FIXED(tabstrip_.get()), tab->widget(), |
| 1569 bds.x(), bds.y()); | 1569 bds.x(), bds.y()); |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 CustomDrawButton* TabStripGtk::MakeNewTabButton() { | 1572 CustomDrawButton* TabStripGtk::MakeNewTabButton() { |
| 1573 CustomDrawButton* button = new CustomDrawButton(IDR_NEWTAB_BUTTON, | 1573 CustomDrawButton* button = new CustomDrawButton(IDR_NEWTAB_BUTTON, |
| 1574 IDR_NEWTAB_BUTTON_P, IDR_NEWTAB_BUTTON_H, 0); | 1574 IDR_NEWTAB_BUTTON_P, IDR_NEWTAB_BUTTON_H, 0, NULL); |
| 1575 | 1575 |
| 1576 g_signal_connect(G_OBJECT(button->widget()), "clicked", | 1576 g_signal_connect(G_OBJECT(button->widget()), "clicked", |
| 1577 G_CALLBACK(OnNewTabClicked), this); | 1577 G_CALLBACK(OnNewTabClicked), this); |
| 1578 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 1578 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); |
| 1579 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 1579 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
| 1580 | 1580 |
| 1581 return button; | 1581 return button; |
| 1582 } | 1582 } |
| 1583 | 1583 |
| 1584 #if defined(LINUX2) | 1584 #if defined(LINUX2) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1604 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE); | 1604 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE); |
| 1605 GtkWidget* browser_widget = GTK_WIDGET( | 1605 GtkWidget* browser_widget = GTK_WIDGET( |
| 1606 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle()); | 1606 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle()); |
| 1607 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget)); | 1607 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget)); |
| 1608 TabOverviewTypes::instance()->SendMessage(message); | 1608 TabOverviewTypes::instance()->SendMessage(message); |
| 1609 | 1609 |
| 1610 UserMetrics::RecordAction(L"TabOverview_PressedTabOverviewButton", | 1610 UserMetrics::RecordAction(L"TabOverview_PressedTabOverviewButton", |
| 1611 tabstrip->model_->profile()); | 1611 tabstrip->model_->profile()); |
| 1612 } | 1612 } |
| 1613 #endif | 1613 #endif |
| OLD | NEW |