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_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 if (previous_tab_bounds.right() - GetLayoutConstant(TABSTRIP_TAB_OVERLAP) != | 1193 if (previous_tab_bounds.right() - GetLayoutConstant(TABSTRIP_TAB_OVERLAP) != |
1194 tab_bounds.x()) { | 1194 tab_bounds.x()) { |
1195 int x = previous_tab_bounds.right() - tab_bounds.x() - | 1195 int x = previous_tab_bounds.right() - tab_bounds.x() - |
1196 kStackedTabRightClip; | 1196 kStackedTabRightClip; |
1197 clip->SetRect(x, 0, tab_bounds.width() - x, tab_bounds.height()); | 1197 clip->SetRect(x, 0, tab_bounds.width() - x, tab_bounds.height()); |
1198 } | 1198 } |
1199 } | 1199 } |
1200 return true; | 1200 return true; |
1201 } | 1201 } |
1202 | 1202 |
| 1203 bool TabStrip::CanPaintThrobberToLayer() const { |
| 1204 // Disable layer-painting of throbbers if dragging, if any tab animation is in |
| 1205 // progress, or if stacked tabs are enabled. |
| 1206 const bool dragging = drag_controller_ && drag_controller_->started_drag(); |
| 1207 return !touch_layout_ && !dragging && !IsAnimating(); |
| 1208 } |
| 1209 |
1203 bool TabStrip::IsImmersiveStyle() const { | 1210 bool TabStrip::IsImmersiveStyle() const { |
1204 return immersive_style_; | 1211 return immersive_style_; |
1205 } | 1212 } |
1206 | 1213 |
1207 int TabStrip::GetBackgroundResourceId(bool* custom_image) const { | 1214 int TabStrip::GetBackgroundResourceId(bool* custom_image) const { |
1208 const ui::ThemeProvider* theme_provider = GetThemeProvider(); | 1215 const ui::ThemeProvider* theme_provider = GetThemeProvider(); |
1209 | 1216 |
1210 if (GetWidget()->ShouldWindowContentsBeTransparent()) { | 1217 if (GetWidget()->ShouldWindowContentsBeTransparent()) { |
1211 const int kBackgroundIdGlass = IDR_THEME_TAB_BACKGROUND_V; | 1218 const int kBackgroundIdGlass = IDR_THEME_TAB_BACKGROUND_V; |
1212 *custom_image = theme_provider->HasCustomImage(kBackgroundIdGlass); | 1219 *custom_image = theme_provider->HasCustomImage(kBackgroundIdGlass); |
(...skipping 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2681 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2688 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
2682 if (view) | 2689 if (view) |
2683 return view; | 2690 return view; |
2684 } | 2691 } |
2685 Tab* tab = FindTabForEvent(point); | 2692 Tab* tab = FindTabForEvent(point); |
2686 if (tab) | 2693 if (tab) |
2687 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2694 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
2688 } | 2695 } |
2689 return this; | 2696 return this; |
2690 } | 2697 } |
OLD | NEW |