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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1710253003: Misc. Tab-related cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better structure for #ifdefs Created 4 years, 10 months 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 32edbdc985da732234388ec83d279d2b9dbbc2a1..9a5bc9bc2e159bec20e2bec044e354e343a30ee2 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -756,7 +756,7 @@ void TabStrip::StopAllHighlighting() {
void TabStrip::AddTabAt(int model_index,
const TabRendererData& data,
bool is_active) {
- Tab* tab = CreateTab();
+ Tab* tab = new Tab(this, animation_container_.get());
AddChildView(tab);
tab->SetData(data);
UpdateTabsClosingMap(model_index, 1);
@@ -1093,18 +1093,16 @@ void TabStrip::SetImmersiveStyle(bool enable) {
}
SkAlpha TabStrip::GetInactiveAlpha(bool for_new_tab_button) const {
- static const SkAlpha kInactiveTabAlphaOpaque = 255;
- static const double kMultiSelectionMultiplier = 0.6;
-
- SkAlpha base_alpha = kInactiveTabAlphaOpaque;
#if defined(USE_ASH)
static const SkAlpha kInactiveTabAlphaAsh = 230;
- base_alpha = kInactiveTabAlphaAsh;
+ const SkAlpha base_alpha = kInactiveTabAlphaAsh;
#else
static const SkAlpha kInactiveTabAlphaGlass = 200;
- if (GetWidget()->ShouldWindowContentsBeTransparent())
- base_alpha = kInactiveTabAlphaGlass;
+ static const SkAlpha kInactiveTabAlphaOpaque = 255;
+ const SkAlpha base_alpha = GetWidget()->ShouldWindowContentsBeTransparent() ?
+ kInactiveTabAlphaGlass : kInactiveTabAlphaOpaque;
#endif // USE_ASH
+ static const double kMultiSelectionMultiplier = 0.6;
return (for_new_tab_button || (GetSelectionModel().size() <= 1)) ?
base_alpha : static_cast<SkAlpha>(kMultiSelectionMultiplier * base_alpha);
}
@@ -1402,9 +1400,9 @@ int TabStrip::GetBackgroundResourceId(bool* custom_image) const {
const bool incognito = controller()->IsIncognito();
const int id = incognito ?
IDR_THEME_TAB_BACKGROUND_INCOGNITO : IDR_THEME_TAB_BACKGROUND;
- const int frame_id = incognito ? IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME;
- *custom_image = tp->HasCustomImage(id) || tp->HasCustomImage(frame_id) ||
- (incognito && tp->HasCustomImage(IDR_THEME_FRAME));
+ *custom_image =
+ tp->HasCustomImage(id) || tp->HasCustomImage(IDR_THEME_FRAME) ||
+ (incognito && tp->HasCustomImage(IDR_THEME_FRAME_INCOGNITO));
return id;
}
@@ -1704,12 +1702,6 @@ void TabStrip::Init() {
}
}
-Tab* TabStrip::CreateTab() {
- Tab* tab = new Tab(this);
- tab->SetAnimationContainer(animation_container_.get());
- return tab;
-}
-
void TabStrip::StartInsertTabAnimation(int model_index) {
PrepareForAnimation();
« 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