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

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

Issue 2690443002: cros-md: Remove the non-MD immersive mode code paths (Closed)
Patch Set: remove unused conditions Created 3 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
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 c11d5fc62110793ebd1d10adec2599bf34ee405f..c78a965d1249a55e2c33776dceb401fdce47f010 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -595,7 +595,7 @@ TabStrip::TabStrip(TabStripController* controller)
adjust_layout_(false),
reset_to_shrink_on_exit_(false),
mouse_move_count_(0),
- immersive_style_(false) {
+ offscreen_(false) {
Init();
SetEventTargeter(
std::unique_ptr<views::ViewTargeter>(new views::ViewTargeter(this)));
@@ -1019,12 +1019,6 @@ void TabStrip::SetBackgroundOffset(const gfx::Point& offset) {
newtab_button_->set_background_offset(offset);
}
-void TabStrip::SetImmersiveStyle(bool enable) {
- if (immersive_style_ == enable)
- return;
- immersive_style_ = enable;
-}
-
SkAlpha TabStrip::GetInactiveAlpha(bool for_new_tab_button) const {
#if defined(USE_ASH)
static const SkAlpha kInactiveTabAlphaAsh = 230;
@@ -1166,10 +1160,6 @@ void TabStrip::MaybeStartDrag(
return;
}
- // Do not do any dragging of tabs when using the super short immersive style.
- if (IsImmersiveStyle())
- return;
-
int model_index = GetModelIndexOfTab(tab);
if (!IsValidModelIndex(model_index)) {
CHECK(false);
@@ -1309,18 +1299,14 @@ bool TabStrip::ShouldPaintTab(
bool TabStrip::CanPaintThrobberToLayer() const {
// Disable layer-painting of throbbers if dragging, if any tab animation is in
// progress, or if stacked tabs are enabled. Also disable in fullscreen: when
- // "immersive" the tab strip could be sliding in or out while transitioning to
- // or away from |immersive_style_| and, for other modes, there's no tab strip.
+ // "immersive" the tab strip could be sliding in or out; for other modes,
+ // there's no tab strip.
const bool dragging = drag_controller_ && drag_controller_->started_drag();
const views::Widget* widget = GetWidget();
return widget && !touch_layout_ && !dragging && !IsAnimating() &&
!widget->IsFullscreen();
}
-bool TabStrip::IsImmersiveStyle() const {
- return immersive_style_;
-}
-
SkColor TabStrip::GetToolbarTopSeparatorColor() const {
return controller_->GetToolbarTopSeparatorColor();
}
@@ -1516,8 +1502,7 @@ gfx::Size TabStrip::GetPreferredSize() const {
std::max(needed_tab_width, min_selected_width), largest_min_tab_width);
}
return gfx::Size(needed_tab_width + GetNewTabButtonWidth(),
- immersive_style_ ? Tab::GetImmersiveHeight()
- : Tab::GetMinimumInactiveSize().height());
+ offscreen_ ? 0 : Tab::GetMinimumInactiveSize().height());
sky 2017/02/14 22:40:57 Why do you need to change this? I'm wondering why
Qiang(Joe) Xu 2017/02/15 05:57:02 If always return GetMinimumInactiveSize, that will
sky 2017/02/15 16:30:08 Sure, but why does this matter? Isn't the tabstrip
Qiang(Joe) Xu 2017/02/15 23:24:14 I updated this patch. Two main changes in new patc
}
void TabStrip::OnDragEntered(const DropTargetEvent& event) {
@@ -1617,11 +1602,6 @@ views::View* TabStrip::GetTooltipHandlerForPoint(const gfx::Point& point) {
return this;
}
-// static
-int TabStrip::GetImmersiveHeight() {
- return Tab::GetImmersiveHeight();
-}
-
///////////////////////////////////////////////////////////////////////////////
// TabStrip, private:

Powered by Google App Engine
This is Rietveld 408576698