| 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" |
| 11 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 12 #include "app/slide_animation.h" | 12 #include "app/slide_animation.h" |
| 13 #include "base/gfx/gtk_util.h" | 13 #include "base/gfx/gtk_util.h" |
| 14 #include "base/gfx/point.h" | 14 #include "base/gfx/point.h" |
| 15 #include "chrome/browser/browser_theme_provider.h" | 15 #include "chrome/browser/browser_theme_provider.h" |
| 16 #include "chrome/browser/gtk/custom_button.h" | 16 #include "chrome/browser/gtk/custom_button.h" |
| 17 #include "chrome/browser/gtk/gtk_dnd_util.h" | 17 #include "chrome/browser/gtk/gtk_dnd_util.h" |
| 18 #include "chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h" | 18 #include "chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h" |
| 19 #include "chrome/browser/profile.h" | 19 #include "chrome/browser/profile.h" |
| 20 #include "chrome/browser/tab_contents/tab_contents.h" | 20 #include "chrome/browser/tab_contents/tab_contents.h" |
| 21 #include "chrome/common/gtk_util.h" | 21 #include "chrome/common/gtk_util.h" |
| 22 #include "grit/app_resources.h" | 22 #include "grit/app_resources.h" |
| 23 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
| 24 | 24 |
| 25 #if defined(LINUX2) | 25 #if defined(LINUX2) |
| 26 #include "chrome/browser/browser.h" | 26 #include "chrome/browser/browser.h" |
| 27 #include "chrome/browser/browser_list.h" | 27 #include "chrome/browser/browser_list.h" |
| 28 #include "chrome/browser/gtk/browser_window_gtk.h" | 28 #include "chrome/browser/gtk/browser_window_gtk.h" |
| 29 #include "chrome/browser/metrics/user_metrics.h" |
| 29 #include "chrome/browser/views/tabs/tab_overview_types.h" | 30 #include "chrome/browser/views/tabs/tab_overview_types.h" |
| 30 #include "chrome/common/x11_util.h" | 31 #include "chrome/common/x11_util.h" |
| 31 #endif | 32 #endif |
| 32 | 33 |
| 33 namespace { | 34 namespace { |
| 34 | 35 |
| 35 const int kDefaultAnimationDurationMs = 100; | 36 const int kDefaultAnimationDurationMs = 100; |
| 36 const int kResizeLayoutAnimationDurationMs = 166; | 37 const int kResizeLayoutAnimationDurationMs = 166; |
| 37 const int kReorderAnimationDurationMs = 166; | 38 const int kReorderAnimationDurationMs = 166; |
| 38 const int kAnimateToBoundsDurationMs = 150; | 39 const int kAnimateToBoundsDurationMs = 150; |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1598 TabStripGtk* tabstrip) { | 1599 TabStripGtk* tabstrip) { |
| 1599 Browser* browser = BrowserList::GetLastActive(); | 1600 Browser* browser = BrowserList::GetLastActive(); |
| 1600 DCHECK(browser); // In order for the user to click on the tab there should | 1601 DCHECK(browser); // In order for the user to click on the tab there should |
| 1601 // be an active browser. | 1602 // be an active browser. |
| 1602 TabOverviewTypes::Message message; | 1603 TabOverviewTypes::Message message; |
| 1603 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE); | 1604 message.set_type(TabOverviewTypes::Message::WM_SWITCH_TO_OVERVIEW_MODE); |
| 1604 GtkWidget* browser_widget = GTK_WIDGET( | 1605 GtkWidget* browser_widget = GTK_WIDGET( |
| 1605 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle()); | 1606 static_cast<BrowserWindowGtk*>(browser->window())->GetNativeHandle()); |
| 1606 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget)); | 1607 message.set_param(0, x11_util::GetX11WindowFromGtkWidget(browser_widget)); |
| 1607 TabOverviewTypes::instance()->SendMessage(message); | 1608 TabOverviewTypes::instance()->SendMessage(message); |
| 1609 |
| 1610 UserMetrics::RecordAction(L"TabOverview_PressedTabOverviewButton", |
| 1611 tabstrip->model_->profile()); |
| 1608 } | 1612 } |
| 1609 #endif | 1613 #endif |
| OLD | NEW |