Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1477713002: Paint tab-loading throbbers into a ui::Layer (reland). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for r362326 and r362195 conflicts Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/tabs/tab_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | chrome/browser/ui/views/tabs/tab_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698