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/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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 return value; | 51 return value; |
52 } | 52 } |
53 | 53 |
54 int top_padding() { | 54 int top_padding() { |
55 static int value = -1; | 55 static int value = -1; |
56 if (value == -1) { | 56 if (value == -1) { |
57 switch (ui::GetDisplayLayout()) { | 57 switch (ui::GetDisplayLayout()) { |
58 case ui::LAYOUT_ASH: | 58 case ui::LAYOUT_ASH: |
59 case ui::LAYOUT_DESKTOP: | 59 case ui::LAYOUT_DESKTOP: |
60 value = 8; | 60 value = 6; |
61 break; | 61 break; |
62 case ui::LAYOUT_TOUCH: | 62 case ui::LAYOUT_TOUCH: |
63 value = 12; | 63 value = 12; |
64 break; | 64 break; |
65 default: | 65 default: |
66 NOTREACHED(); | 66 NOTREACHED(); |
67 } | 67 } |
68 } | 68 } |
69 return value; | 69 return value; |
70 } | 70 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 static const int kTitleCloseButtonSpacing = 3; | 159 static const int kTitleCloseButtonSpacing = 3; |
160 static const int kStandardTitleWidth = 175; | 160 static const int kStandardTitleWidth = 175; |
161 #if defined(USE_ASH) | 161 #if defined(USE_ASH) |
162 // Additional vertical offset for close button relative to top of tab. | 162 // Additional vertical offset for close button relative to top of tab. |
163 // Ash needs this to match the text vertical position. | 163 // Ash needs this to match the text vertical position. |
164 static const int kCloseButtonVertFuzz = 1; | 164 static const int kCloseButtonVertFuzz = 1; |
165 #else | 165 #else |
166 static const int kCloseButtonVertFuzz = 0; | 166 static const int kCloseButtonVertFuzz = 0; |
167 #endif | 167 #endif |
168 // Additional horizontal offset for close button relative to title text. | 168 // Additional horizontal offset for close button relative to title text. |
169 static const int kCloseButtonHorzFuzz = 7; | 169 static const int kCloseButtonHorzFuzz = 3; |
170 | 170 |
171 // When a non-mini-tab becomes a mini-tab the width of the tab animates. If | 171 // When a non-mini-tab becomes a mini-tab the width of the tab animates. If |
172 // the width of a mini-tab is >= kMiniTabRendererAsNormalTabWidth then the tab | 172 // the width of a mini-tab is >= kMiniTabRendererAsNormalTabWidth then the tab |
173 // is rendered as a normal tab. This is done to avoid having the title | 173 // is rendered as a normal tab. This is done to avoid having the title |
174 // immediately disappear when transitioning a tab from normal to mini-tab. | 174 // immediately disappear when transitioning a tab from normal to mini-tab. |
175 static const int kMiniTabRendererAsNormalTabWidth = | 175 static const int kMiniTabRendererAsNormalTabWidth = |
176 browser_defaults::kMiniTabWidth + 30; | 176 browser_defaults::kMiniTabWidth + 30; |
177 | 177 |
178 // How opaque to make the hover state (out of 1). | 178 // How opaque to make the hover state (out of 1). |
179 static const double kHoverOpacity = 0.33; | 179 static const double kHoverOpacity = 0.33; |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_RIGHT_SEARCH); | 815 rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_RIGHT_SEARCH); |
816 tab_active_search_.l_width = tab_active_search_.image_l->width(); | 816 tab_active_search_.l_width = tab_active_search_.image_l->width(); |
817 tab_active_search_.r_width = tab_active_search_.image_r->width(); | 817 tab_active_search_.r_width = tab_active_search_.image_r->width(); |
818 | 818 |
819 tab_inactive_.image_l = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_LEFT); | 819 tab_inactive_.image_l = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_LEFT); |
820 tab_inactive_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER); | 820 tab_inactive_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER); |
821 tab_inactive_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT); | 821 tab_inactive_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT); |
822 tab_inactive_.l_width = tab_inactive_.image_l->width(); | 822 tab_inactive_.l_width = tab_inactive_.image_l->width(); |
823 tab_inactive_.r_width = tab_inactive_.image_r->width(); | 823 tab_inactive_.r_width = tab_inactive_.image_r->width(); |
824 } | 824 } |
OLD | NEW |