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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 // instance) are automatically mirrored by the mirroring infrastructure in | 303 // instance) are automatically mirrored by the mirroring infrastructure in |
304 // views. The elements Tab draws directly on the canvas need to be manually | 304 // views. The elements Tab draws directly on the canvas need to be manually |
305 // mirrored if the View's layout is right-to-left. | 305 // mirrored if the View's layout is right-to-left. |
306 title_bounds_.set_x(GetMirroredXForRect(title_bounds_)); | 306 title_bounds_.set_x(GetMirroredXForRect(title_bounds_)); |
307 } | 307 } |
308 | 308 |
309 void Tab::OnThemeChanged() { | 309 void Tab::OnThemeChanged() { |
310 LoadTabImages(); | 310 LoadTabImages(); |
311 } | 311 } |
312 | 312 |
| 313 std::string Tab::GetClassName() const { |
| 314 return kViewClassName; |
| 315 } |
| 316 |
313 bool Tab::HasHitTestMask() const { | 317 bool Tab::HasHitTestMask() const { |
314 return true; | 318 return true; |
315 } | 319 } |
316 | 320 |
317 void Tab::GetHitTestMask(gfx::Path* path) const { | 321 void Tab::GetHitTestMask(gfx::Path* path) const { |
318 DCHECK(path); | 322 DCHECK(path); |
319 | 323 |
320 SkScalar h = SkIntToScalar(height()); | 324 SkScalar h = SkIntToScalar(height()); |
321 SkScalar w = SkIntToScalar(width()); | 325 SkScalar w = SkIntToScalar(width()); |
322 | 326 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 667 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
664 tab_active_.l_width = tab_active_.image_l->width(); | 668 tab_active_.l_width = tab_active_.image_l->width(); |
665 tab_active_.r_width = tab_active_.image_r->width(); | 669 tab_active_.r_width = tab_active_.image_r->width(); |
666 | 670 |
667 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 671 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
668 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 672 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
669 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 673 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
670 tab_inactive_.l_width = tab_inactive_.image_l->width(); | 674 tab_inactive_.l_width = tab_inactive_.image_l->width(); |
671 tab_inactive_.r_width = tab_inactive_.image_r->width(); | 675 tab_inactive_.r_width = tab_inactive_.image_r->width(); |
672 } | 676 } |
OLD | NEW |