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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 const int kBarPadding = 1; | 1667 const int kBarPadding = 1; |
1668 int main_bar_left = tab_active_.l_width - kBarPadding; | 1668 int main_bar_left = tab_active_.l_width - kBarPadding; |
1669 int main_bar_right = width() - tab_active_.r_width + kBarPadding; | 1669 int main_bar_right = width() - tab_active_.r_width + kBarPadding; |
1670 return gfx::Rect( | 1670 return gfx::Rect( |
1671 main_bar_left, 0, main_bar_right - main_bar_left, kImmersiveBarHeight); | 1671 main_bar_left, 0, main_bar_right - main_bar_left, kImmersiveBarHeight); |
1672 } | 1672 } |
1673 | 1673 |
1674 void Tab::GetTabIdAndFrameId(views::Widget* widget, | 1674 void Tab::GetTabIdAndFrameId(views::Widget* widget, |
1675 int* tab_id, | 1675 int* tab_id, |
1676 int* frame_id) const { | 1676 int* frame_id) const { |
1677 if (widget && widget->GetTopLevelWidget()->ShouldUseNativeFrame()) { | 1677 if (widget && |
| 1678 widget->GetTopLevelWidget()->ShouldWindowContentsBeTransparent()) { |
1678 *tab_id = IDR_THEME_TAB_BACKGROUND_V; | 1679 *tab_id = IDR_THEME_TAB_BACKGROUND_V; |
1679 *frame_id = 0; | 1680 *frame_id = 0; |
1680 } else if (data().incognito) { | 1681 } else if (data().incognito) { |
1681 *tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO; | 1682 *tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO; |
1682 *frame_id = IDR_THEME_FRAME_INCOGNITO; | 1683 *frame_id = IDR_THEME_FRAME_INCOGNITO; |
1683 #if defined(OS_WIN) | 1684 #if defined(OS_WIN) |
1684 } else if (win8::IsSingleWindowMetroMode()) { | 1685 } else if (win8::IsSingleWindowMetroMode()) { |
1685 *tab_id = IDR_THEME_TAB_BACKGROUND_V; | 1686 *tab_id = IDR_THEME_TAB_BACKGROUND_V; |
1686 *frame_id = 0; | 1687 *frame_id = 0; |
1687 #endif | 1688 #endif |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 const gfx::ImageSkia& image) { | 1754 const gfx::ImageSkia& image) { |
1754 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1755 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
1755 ImageCacheEntry entry; | 1756 ImageCacheEntry entry; |
1756 entry.resource_id = resource_id; | 1757 entry.resource_id = resource_id; |
1757 entry.scale_factor = scale_factor; | 1758 entry.scale_factor = scale_factor; |
1758 entry.image = image; | 1759 entry.image = image; |
1759 image_cache_->push_front(entry); | 1760 image_cache_->push_front(entry); |
1760 if (image_cache_->size() > kMaxImageCacheSize) | 1761 if (image_cache_->size() > kMaxImageCacheSize) |
1761 image_cache_->pop_back(); | 1762 image_cache_->pop_back(); |
1762 } | 1763 } |
OLD | NEW |