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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "ui/gfx/rect_conversions.h" | 42 #include "ui/gfx/rect_conversions.h" |
43 #include "ui/gfx/skia_util.h" | 43 #include "ui/gfx/skia_util.h" |
44 #include "ui/gfx/text_elider.h" | 44 #include "ui/gfx/text_elider.h" |
45 #include "ui/views/border.h" | 45 #include "ui/views/border.h" |
46 #include "ui/views/controls/button/image_button.h" | 46 #include "ui/views/controls/button/image_button.h" |
47 #include "ui/views/rect_based_targeting_utils.h" | 47 #include "ui/views/rect_based_targeting_utils.h" |
48 #include "ui/views/widget/tooltip_manager.h" | 48 #include "ui/views/widget/tooltip_manager.h" |
49 #include "ui/views/widget/widget.h" | 49 #include "ui/views/widget/widget.h" |
50 #include "ui/views/window/non_client_view.h" | 50 #include "ui/views/window/non_client_view.h" |
51 | 51 |
52 #if defined(OS_WIN) | |
53 #include "win8/util/win8_util.h" | |
54 #endif | |
55 | |
56 #if defined(USE_ASH) | 52 #if defined(USE_ASH) |
57 #include "ui/aura/env.h" | 53 #include "ui/aura/env.h" |
58 #endif | 54 #endif |
59 | 55 |
60 namespace { | 56 namespace { |
61 | 57 |
62 // Padding around the "content" of a tab, occupied by the tab border graphics. | 58 // Padding around the "content" of a tab, occupied by the tab border graphics. |
63 | 59 |
64 int left_padding() { | 60 int left_padding() { |
65 static int value = -1; | 61 static int value = -1; |
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1674 void Tab::GetTabIdAndFrameId(views::Widget* widget, | 1670 void Tab::GetTabIdAndFrameId(views::Widget* widget, |
1675 int* tab_id, | 1671 int* tab_id, |
1676 int* frame_id) const { | 1672 int* frame_id) const { |
1677 if (widget && | 1673 if (widget && |
1678 widget->GetTopLevelWidget()->ShouldWindowContentsBeTransparent()) { | 1674 widget->GetTopLevelWidget()->ShouldWindowContentsBeTransparent()) { |
1679 *tab_id = IDR_THEME_TAB_BACKGROUND_V; | 1675 *tab_id = IDR_THEME_TAB_BACKGROUND_V; |
1680 *frame_id = 0; | 1676 *frame_id = 0; |
1681 } else if (data().incognito) { | 1677 } else if (data().incognito) { |
1682 *tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO; | 1678 *tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO; |
1683 *frame_id = IDR_THEME_FRAME_INCOGNITO; | 1679 *frame_id = IDR_THEME_FRAME_INCOGNITO; |
1684 #if defined(OS_WIN) | |
1685 } else if (win8::IsSingleWindowMetroMode()) { | |
1686 *tab_id = IDR_THEME_TAB_BACKGROUND_V; | |
1687 *frame_id = 0; | |
1688 #endif | |
1689 } else { | 1680 } else { |
1690 *tab_id = IDR_THEME_TAB_BACKGROUND; | 1681 *tab_id = IDR_THEME_TAB_BACKGROUND; |
1691 *frame_id = IDR_THEME_FRAME; | 1682 *frame_id = IDR_THEME_FRAME; |
1692 } | 1683 } |
1693 } | 1684 } |
1694 | 1685 |
1695 //////////////////////////////////////////////////////////////////////////////// | 1686 //////////////////////////////////////////////////////////////////////////////// |
1696 // Tab, private static: | 1687 // Tab, private static: |
1697 | 1688 |
1698 // static | 1689 // static |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 const gfx::ImageSkia& image) { | 1745 const gfx::ImageSkia& image) { |
1755 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1746 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
1756 ImageCacheEntry entry; | 1747 ImageCacheEntry entry; |
1757 entry.resource_id = resource_id; | 1748 entry.resource_id = resource_id; |
1758 entry.scale_factor = scale_factor; | 1749 entry.scale_factor = scale_factor; |
1759 entry.image = image; | 1750 entry.image = image; |
1760 image_cache_->push_front(entry); | 1751 image_cache_->push_front(entry); |
1761 if (image_cache_->size() > kMaxImageCacheSize) | 1752 if (image_cache_->size() > kMaxImageCacheSize) |
1762 image_cache_->pop_back(); | 1753 image_cache_->pop_back(); |
1763 } | 1754 } |
OLD | NEW |