OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/gtk/tabs/tab_strip_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/autocomplete/autocomplete.h" | 12 #include "chrome/browser/autocomplete/autocomplete.h" |
13 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 13 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
14 #include "chrome/browser/autocomplete/autocomplete_match.h" | 14 #include "chrome/browser/autocomplete/autocomplete_match.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/tab_contents/tab_contents.h" | 16 #include "chrome/browser/tab_contents/tab_contents.h" |
17 #include "chrome/browser/tabs/tab_strip_model_delegate.h" | 17 #include "chrome/browser/tabs/tab_strip_model_delegate.h" |
18 #include "chrome/browser/themes/browser_theme_provider.h" | 18 #include "chrome/browser/themes/browser_theme_provider.h" |
19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/browser_navigator.h" | 20 #include "chrome/browser/ui/browser_navigator.h" |
21 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 21 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
22 #include "chrome/browser/ui/gtk/custom_button.h" | 22 #include "chrome/browser/ui/gtk/custom_button.h" |
23 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" | 23 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
24 #include "chrome/browser/ui/gtk/gtk_util.h" | 24 #include "chrome/browser/ui/gtk/gtk_util.h" |
25 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" | 25 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" |
26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
27 #include "chrome/common/notification_service.h" | 27 #include "chrome/common/notification_service.h" |
28 #include "chrome/common/notification_type.h" | 28 #include "chrome/common/notification_type.h" |
29 #include "gfx/gtk_util.h" | |
30 #include "gfx/point.h" | |
31 #include "grit/app_resources.h" | 29 #include "grit/app_resources.h" |
32 #include "grit/theme_resources.h" | 30 #include "grit/theme_resources.h" |
33 #include "ui/base/animation/animation_delegate.h" | 31 #include "ui/base/animation/animation_delegate.h" |
34 #include "ui/base/animation/slide_animation.h" | 32 #include "ui/base/animation/slide_animation.h" |
35 #include "ui/base/dragdrop/gtk_dnd_util.h" | 33 #include "ui/base/dragdrop/gtk_dnd_util.h" |
36 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 35 #include "ui/gfx/gtk_util.h" |
| 36 #include "ui/gfx/point.h" |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 const int kDefaultAnimationDurationMs = 100; | 40 const int kDefaultAnimationDurationMs = 100; |
41 const int kResizeLayoutAnimationDurationMs = 166; | 41 const int kResizeLayoutAnimationDurationMs = 166; |
42 const int kReorderAnimationDurationMs = 166; | 42 const int kReorderAnimationDurationMs = 166; |
43 const int kAnimateToBoundsDurationMs = 150; | 43 const int kAnimateToBoundsDurationMs = 150; |
44 const int kMiniTabAnimationDurationMs = 150; | 44 const int kMiniTabAnimationDurationMs = 150; |
45 | 45 |
46 const int kNewTabButtonHOffset = -5; | 46 const int kNewTabButtonHOffset = -5; |
(...skipping 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2057 | 2057 |
2058 // Let the middle mouse button initiate clicks as well. | 2058 // Let the middle mouse button initiate clicks as well. |
2059 gtk_util::SetButtonTriggersNavigation(button->widget()); | 2059 gtk_util::SetButtonTriggersNavigation(button->widget()); |
2060 g_signal_connect(button->widget(), "clicked", | 2060 g_signal_connect(button->widget(), "clicked", |
2061 G_CALLBACK(OnNewTabClickedThunk), this); | 2061 G_CALLBACK(OnNewTabClickedThunk), this); |
2062 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); | 2062 GTK_WIDGET_UNSET_FLAGS(button->widget(), GTK_CAN_FOCUS); |
2063 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); | 2063 gtk_fixed_put(GTK_FIXED(tabstrip_.get()), button->widget(), 0, 0); |
2064 | 2064 |
2065 return button; | 2065 return button; |
2066 } | 2066 } |
OLD | NEW |