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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 } | 443 } |
444 | 444 |
445 void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) { | 445 void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) { |
446 // The tab image needs to be lined up with the background image | 446 // The tab image needs to be lined up with the background image |
447 // so that it feels partially transparent. These offsets represent the tab | 447 // so that it feels partially transparent. These offsets represent the tab |
448 // position within the frame background image. | 448 // position within the frame background image. |
449 int offset = GetMirroredX() + background_offset_.x(); | 449 int offset = GetMirroredX() + background_offset_.x(); |
450 | 450 |
451 int tab_id; | 451 int tab_id; |
452 if (GetWidget() && | 452 if (GetWidget() && |
453 GetWidget()->GetContainingWindow()->ShouldUseNativeFrame()) { | 453 GetWidget()->GetContainingWindow()->non_client_view()->UseNativeFrame()) { |
454 tab_id = IDR_THEME_TAB_BACKGROUND_V; | 454 tab_id = IDR_THEME_TAB_BACKGROUND_V; |
455 } else { | 455 } else { |
456 tab_id = data().incognito ? IDR_THEME_TAB_BACKGROUND_INCOGNITO : | 456 tab_id = data().incognito ? IDR_THEME_TAB_BACKGROUND_INCOGNITO : |
457 IDR_THEME_TAB_BACKGROUND; | 457 IDR_THEME_TAB_BACKGROUND; |
458 } | 458 } |
459 | 459 |
460 SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(tab_id); | 460 SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(tab_id); |
461 | 461 |
462 TabImage* tab_image = &tab_active_; | 462 TabImage* tab_image = &tab_active_; |
463 TabImage* tab_inactive_image = &tab_inactive_; | 463 TabImage* tab_inactive_image = &tab_inactive_; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); | 677 tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT); |
678 tab_active_.l_width = tab_active_.image_l->width(); | 678 tab_active_.l_width = tab_active_.image_l->width(); |
679 tab_active_.r_width = tab_active_.image_r->width(); | 679 tab_active_.r_width = tab_active_.image_r->width(); |
680 | 680 |
681 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); | 681 tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT); |
682 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); | 682 tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER); |
683 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); | 683 tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT); |
684 tab_inactive_.l_width = tab_inactive_.image_l->width(); | 684 tab_inactive_.l_width = tab_inactive_.image_l->width(); |
685 tab_inactive_.r_width = tab_inactive_.image_r->width(); | 685 tab_inactive_.r_width = tab_inactive_.image_r->width(); |
686 } | 686 } |
OLD | NEW |