Commit a71d2135 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Expand single-tab mode to Touchable Refresh

Makes use of the new MaterialDesignerController::IsRefreshUi() method
instead of MD::GetMode() == MATERIAL_REFRESH.

Bug: chromium:839972
Change-Id: Ib75590ce3dbc103d7e75927d8636755c1f581903
Reviewed-on: https://chromium-review.googlesource.com/1058601
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558570}
parent 2a246a60
......@@ -132,16 +132,14 @@ void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from,
}
void BrowserNonClientFrameView::OnTabAdded(int index) {
if (MD::GetMode() == MD::MATERIAL_REFRESH &&
browser_view()->tabstrip()->tab_count() == 2) {
if (MD::IsRefreshUi() && browser_view()->tabstrip()->tab_count() == 2) {
// We are exiting single-tab mode and need to repaint the frame.
SchedulePaint();
}
}
void BrowserNonClientFrameView::OnTabRemoved(int index) {
if (MD::GetMode() == MD::MATERIAL_REFRESH &&
browser_view()->tabstrip()->tab_count() == 1) {
if (MD::IsRefreshUi() && browser_view()->tabstrip()->tab_count() == 1) {
// We are entering single-tab mode and need to repaint the frame.
SchedulePaint();
}
......@@ -155,7 +153,7 @@ bool BrowserNonClientFrameView::ShouldPaintAsSingleTabMode() const {
// Single-tab mode is only available in Refresh. The special color we use for
// won't be visible if there's a frame image, but since it's used to determine
// constrast of other UI elements, the theme color should be used instead.
return MD::GetMode() == MD::MATERIAL_REFRESH && GetFrameImage().isNull() &&
return MD::IsRefreshUi() && GetFrameImage().isNull() &&
browser_view()->IsTabStripVisible() &&
browser_view()->tabstrip()->tab_count() == 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment