| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "ui/gfx/point.h" | 51 #include "ui/gfx/point.h" |
| 52 | 52 |
| 53 using content::UserMetricsAction; | 53 using content::UserMetricsAction; |
| 54 using content::WebContents; | 54 using content::WebContents; |
| 55 | 55 |
| 56 namespace { | 56 namespace { |
| 57 | 57 |
| 58 const int kDefaultAnimationDurationMs = 100; | 58 const int kDefaultAnimationDurationMs = 100; |
| 59 const int kResizeLayoutAnimationDurationMs = 166; | 59 const int kResizeLayoutAnimationDurationMs = 166; |
| 60 const int kReorderAnimationDurationMs = 166; | 60 const int kReorderAnimationDurationMs = 166; |
| 61 const int kAnimateToBoundsDurationMs = 150; | |
| 62 const int kMiniTabAnimationDurationMs = 150; | 61 const int kMiniTabAnimationDurationMs = 150; |
| 63 | 62 |
| 64 const int kNewTabButtonHOffset = -5; | 63 const int kNewTabButtonHOffset = -5; |
| 65 const int kNewTabButtonVOffset = 5; | 64 const int kNewTabButtonVOffset = 5; |
| 66 | 65 |
| 67 // The delay between when the mouse leaves the tabstrip and the resize animation | 66 // The delay between when the mouse leaves the tabstrip and the resize animation |
| 68 // is started. | 67 // is started. |
| 69 const int kResizeTabsTimeMs = 300; | 68 const int kResizeTabsTimeMs = 300; |
| 70 | 69 |
| 71 // A very short time just to make sure we don't clump up our Layout() calls | 70 // A very short time just to make sure we don't clump up our Layout() calls |
| 72 // during slow window resizes. | 71 // during slow window resizes. |
| 73 const int kLayoutAfterSizeAllocateMs = 10; | 72 const int kLayoutAfterSizeAllocateMs = 10; |
| 74 | 73 |
| 75 // The range outside of the tabstrip where the pointer must enter/leave to | 74 // The range outside of the tabstrip where the pointer must enter/leave to |
| 76 // start/stop the resize animation. | 75 // start/stop the resize animation. |
| 77 const int kTabStripAnimationVSlop = 40; | 76 const int kTabStripAnimationVSlop = 40; |
| 78 | 77 |
| 79 const int kHorizontalMoveThreshold = 16; // pixels | |
| 80 | |
| 81 // The horizontal offset from one tab to the next, which results in overlapping | 78 // The horizontal offset from one tab to the next, which results in overlapping |
| 82 // tabs. | 79 // tabs. |
| 83 const int kTabHOffset = -16; | 80 const int kTabHOffset = -16; |
| 84 | 81 |
| 85 // Inverse ratio of the width of a tab edge to the width of the tab. When | 82 // Inverse ratio of the width of a tab edge to the width of the tab. When |
| 86 // hovering over the left or right edge of a tab, the drop indicator will | 83 // hovering over the left or right edge of a tab, the drop indicator will |
| 87 // point between tabs. | 84 // point between tabs. |
| 88 const int kTabEdgeRatioInverse = 4; | 85 const int kTabEdgeRatioInverse = 4; |
| 89 | 86 |
| 90 // Size of the drop indicator. | 87 // Size of the drop indicator. |
| (...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2268 | 2265 |
| 2269 void TabStripGtk::SetNewTabButtonBackground() { | 2266 void TabStripGtk::SetNewTabButtonBackground() { |
| 2270 SkColor color = theme_service_->GetColor( | 2267 SkColor color = theme_service_->GetColor( |
| 2271 ThemeProperties::COLOR_BUTTON_BACKGROUND); | 2268 ThemeProperties::COLOR_BUTTON_BACKGROUND); |
| 2272 SkBitmap background = theme_service_->GetImageNamed( | 2269 SkBitmap background = theme_service_->GetImageNamed( |
| 2273 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); | 2270 IDR_THEME_WINDOW_CONTROL_BACKGROUND).AsBitmap(); |
| 2274 SkBitmap mask = theme_service_->GetImageNamed( | 2271 SkBitmap mask = theme_service_->GetImageNamed( |
| 2275 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); | 2272 IDR_NEWTAB_BUTTON_MASK).AsBitmap(); |
| 2276 newtab_button_->SetBackground(color, background, mask); | 2273 newtab_button_->SetBackground(color, background, mask); |
| 2277 } | 2274 } |
| OLD | NEW |