| 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 27 matching lines...) Expand all Loading... |
| 38 #include "ui/gfx/favicon_size.h" | 38 #include "ui/gfx/favicon_size.h" |
| 39 #include "ui/gfx/font.h" | 39 #include "ui/gfx/font.h" |
| 40 #include "ui/gfx/image/image_skia_operations.h" | 40 #include "ui/gfx/image/image_skia_operations.h" |
| 41 #include "ui/gfx/path.h" | 41 #include "ui/gfx/path.h" |
| 42 #include "ui/views/controls/button/image_button.h" | 42 #include "ui/views/controls/button/image_button.h" |
| 43 #include "ui/views/widget/tooltip_manager.h" | 43 #include "ui/views/widget/tooltip_manager.h" |
| 44 #include "ui/views/widget/widget.h" | 44 #include "ui/views/widget/widget.h" |
| 45 #include "ui/views/window/non_client_view.h" | 45 #include "ui/views/window/non_client_view.h" |
| 46 | 46 |
| 47 #if defined(OS_WIN) | 47 #if defined(OS_WIN) |
| 48 #include "base/win/metro.h" | 48 #include "win8/util/win8_util.h" |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 #if defined(USE_ASH) | 51 #if defined(USE_ASH) |
| 52 #include "ui/aura/env.h" | 52 #include "ui/aura/env.h" |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 // Padding around the "content" of a tab, occupied by the tab border graphics. | 57 // Padding around the "content" of a tab, occupied by the tab border graphics. |
| 58 | 58 |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 } | 1124 } |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) { | 1127 void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) { |
| 1128 int tab_id; | 1128 int tab_id; |
| 1129 if (GetWidget() && GetWidget()->GetTopLevelWidget()->ShouldUseNativeFrame()) { | 1129 if (GetWidget() && GetWidget()->GetTopLevelWidget()->ShouldUseNativeFrame()) { |
| 1130 tab_id = IDR_THEME_TAB_BACKGROUND_V; | 1130 tab_id = IDR_THEME_TAB_BACKGROUND_V; |
| 1131 } else if (data().incognito) { | 1131 } else if (data().incognito) { |
| 1132 tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO; | 1132 tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO; |
| 1133 #if defined(OS_WIN) | 1133 #if defined(OS_WIN) |
| 1134 } else if (base::win::IsMetroProcess()) { | 1134 } else if (win8::IsSingleWindowMetroMode()) { |
| 1135 tab_id = IDR_THEME_TAB_BACKGROUND_V; | 1135 tab_id = IDR_THEME_TAB_BACKGROUND_V; |
| 1136 #endif | 1136 #endif |
| 1137 } else { | 1137 } else { |
| 1138 tab_id = IDR_THEME_TAB_BACKGROUND; | 1138 tab_id = IDR_THEME_TAB_BACKGROUND; |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 const bool can_cache = !GetThemeProvider()->HasCustomImage(tab_id) && | 1141 const bool can_cache = !GetThemeProvider()->HasCustomImage(tab_id) && |
| 1142 !hover_controller_.ShouldDraw(); | 1142 !hover_controller_.ShouldDraw(); |
| 1143 | 1143 |
| 1144 if (can_cache) { | 1144 if (can_cache) { |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 const gfx::ImageSkia& image) { | 1565 const gfx::ImageSkia& image) { |
| 1566 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); | 1566 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); |
| 1567 ImageCacheEntry entry; | 1567 ImageCacheEntry entry; |
| 1568 entry.resource_id = resource_id; | 1568 entry.resource_id = resource_id; |
| 1569 entry.scale_factor = scale_factor; | 1569 entry.scale_factor = scale_factor; |
| 1570 entry.image = image; | 1570 entry.image = image; |
| 1571 image_cache_->push_front(entry); | 1571 image_cache_->push_front(entry); |
| 1572 if (image_cache_->size() > kMaxImageCacheSize) | 1572 if (image_cache_->size() > kMaxImageCacheSize) |
| 1573 image_cache_->pop_back(); | 1573 image_cache_->pop_back(); |
| 1574 } | 1574 } |
| OLD | NEW |