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/views/tabs/tab.h" | 5 #include "chrome/browser/ui/views/tabs/tab.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 static const int kLeftPadding = 16; | 32 static const int kLeftPadding = 16; |
33 static const int kTopPadding = 6; | 33 static const int kTopPadding = 6; |
34 static const int kRightPadding = 15; | 34 static const int kRightPadding = 15; |
35 static const int kBottomPadding = 5; | 35 static const int kBottomPadding = 5; |
36 static const int kDropShadowHeight = 2; | 36 static const int kDropShadowHeight = 2; |
37 static const int kToolbarOverlap = 1; | 37 static const int kToolbarOverlap = 1; |
38 static const int kFaviconTitleSpacing = 4; | 38 static const int kFaviconTitleSpacing = 4; |
39 static const int kTitleCloseButtonSpacing = 3; | 39 static const int kTitleCloseButtonSpacing = 3; |
40 static const int kStandardTitleWidth = 175; | 40 static const int kStandardTitleWidth = 175; |
41 static const int kCloseButtonVertFuzz = 0; | 41 static const int kCloseButtonVertFuzz = 0; |
42 #if defined(TOUCH_UI) | |
43 static const int kTabIconSize = 32; | |
44 static const int kCloseButtonHorzFuzz = -10; | |
45 #else | |
46 static const int kTabIconSize = gfx::kFaviconSize; | 42 static const int kTabIconSize = gfx::kFaviconSize; |
47 static const int kCloseButtonHorzFuzz = 5; | 43 static const int kCloseButtonHorzFuzz = 5; |
48 #endif | |
49 | 44 |
50 // Vertical adjustment to the favicon when the tab has a large icon. | 45 // Vertical adjustment to the favicon when the tab has a large icon. |
51 static const int kAppTapFaviconVerticalAdjustment = 2; | 46 static const int kAppTapFaviconVerticalAdjustment = 2; |
52 | 47 |
53 // When a non-mini-tab becomes a mini-tab the width of the tab animates. If | 48 // When a non-mini-tab becomes a mini-tab the width of the tab animates. If |
54 // the width of a mini-tab is >= kMiniTabRendererAsNormalTabWidth then the tab | 49 // the width of a mini-tab is >= kMiniTabRendererAsNormalTabWidth then the tab |
55 // is rendered as a normal tab. This is done to avoid having the title | 50 // is rendered as a normal tab. This is done to avoid having the title |
56 // immediately disappear when transitioning a tab from normal to mini-tab. | 51 // immediately disappear when transitioning a tab from normal to mini-tab. |
57 static const int kMiniTabRendererAsNormalTabWidth = | 52 static const int kMiniTabRendererAsNormalTabWidth = |
58 browser_defaults::kMiniTabWidth + 30; | 53 browser_defaults::kMiniTabWidth + 30; |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 650 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
656 tab_active_.l_width = tab_active_.image_l->width(); | 651 tab_active_.l_width = tab_active_.image_l->width(); |
657 tab_active_.r_width = tab_active_.image_r->width(); | 652 tab_active_.r_width = tab_active_.image_r->width(); |
658 | 653 |
659 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 654 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
660 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 655 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
661 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 656 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
662 tab_inactive_.l_width = tab_inactive_.image_l->width(); | 657 tab_inactive_.l_width = tab_inactive_.image_l->width(); |
663 tab_inactive_.r_width = tab_inactive_.image_r->width(); | 658 tab_inactive_.r_width = tab_inactive_.image_r->width(); |
664 } | 659 } |
OLD | NEW |