Commit d5dca4f7 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

cros: Remove disable auto hide title bar in tablet mode flag.

Test: trybots
Bug: 764393
Change-Id: I4122ec6a4e722cde7bb048b72e9d579d6edbb151
Reviewed-on: https://chromium-review.googlesource.com/952575Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541503}
parent 41a73f16
......@@ -25,12 +25,6 @@ const char kAshDisableLoginDimAndBlur[] = "ash-disable-login-dim-and-blur";
const char kAshDisableSmoothScreenRotation[] =
"ash-disable-smooth-screen-rotation";
// Disables autohide titlebars feature. With this flag disabled, apps in tablet
// mode will have visible titlebars instead of autohidden titlebars.
// TODO(crbug.com/764393): Remove this flag in M66/M67.
const char kAshDisableTabletAutohideTitlebars[] =
"ash-disable-tablet-autohide-titlebars";
// Disables the split view on tablet mode.
const char kAshDisableTabletSplitView[] = "disable-tablet-splitview";
......
......@@ -21,7 +21,6 @@ ASH_PUBLIC_EXPORT extern const char kAshDebugShortcuts[];
ASH_PUBLIC_EXPORT extern const char kAshDeveloperShortcuts[];
ASH_PUBLIC_EXPORT extern const char kAshDisableLoginDimAndBlur[];
ASH_PUBLIC_EXPORT extern const char kAshDisableSmoothScreenRotation[];
ASH_PUBLIC_EXPORT extern const char kAshDisableTabletAutohideTitlebars[];
ASH_PUBLIC_EXPORT extern const char kAshDisableTabletSplitView[];
ASH_PUBLIC_EXPORT extern const char kAshDisableTrilinearFiltering[];
ASH_PUBLIC_EXPORT extern const char kAshDisableTouchExplorationMode[];
......
......@@ -123,8 +123,6 @@ constexpr char TabletModeController::kLidAngleHistogramName[];
TabletModeController::TabletModeController()
: tablet_mode_usage_interval_start_time_(base::Time::Now()),
tick_clock_(base::DefaultTickClock::GetInstance()),
auto_hide_title_bars_(!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAshDisableTabletAutohideTitlebars)),
binding_(this),
scoped_session_observer_(this),
weak_factory_(this) {
......@@ -225,10 +223,9 @@ void TabletModeController::RemoveObserver(TabletModeObserver* observer) {
}
bool TabletModeController::ShouldAutoHideTitlebars(views::Widget* widget) {
const bool allowed =
auto_hide_title_bars_ && IsTabletModeWindowManagerEnabled();
if (!allowed || !widget)
return allowed;
const bool tablet_mode = IsTabletModeWindowManagerEnabled();
if (!tablet_mode || !widget)
return tablet_mode;
return widget->IsMaximized() ||
wm::GetWindowState(widget->GetNativeWindow())->IsSnapped();
......
......@@ -103,14 +103,11 @@ class ASH_EXPORT TabletModeController
void AddObserver(TabletModeObserver* observer);
void RemoveObserver(TabletModeObserver* observer);
// Checks if we should auto hide title bars in tablet mode. Returns true if
// the feature is enabled and we are in tablet mode. If |widget| is not null
// this also checks if the window associated with |widget| is in an auto hide
// state.
// Checks if we should auto hide title bars in tablet mode. If |widget| is not
// null this also checks if the window associated with |widget| is in an auto
// hide state.
bool ShouldAutoHideTitlebars(views::Widget* widget);
bool auto_hide_title_bars() const { return auto_hide_title_bars_; }
// Flushes the mojo message pipe to chrome.
void FlushForTesting();
......@@ -242,9 +239,6 @@ class ASH_EXPORT TabletModeController
// Last computed lid angle.
double lid_angle_ = 0.0f;
// Whether title bars should be shown be auto hidden in tablet mode.
const bool auto_hide_title_bars_ = false;
// Tracks smoothed accelerometer data over time. This is done when the hinge
// is approaching vertical to remove abrupt acceleration that can lead to
// incorrect calculations of hinge angles.
......
......@@ -3491,12 +3491,6 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnablePixelCanvasRecordingDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kEnablePixelCanvasRecording)},
{"disable-tablet-autohide-titlebars",
flag_descriptions::kDisableTabletAutohideTitlebarsName,
flag_descriptions::kDisableTabletAutohideTitlebarsDescription, kOsCrOS,
SINGLE_DISABLE_VALUE_TYPE(
ash::switches::kAshDisableTabletAutohideTitlebars)},
{"disable-tablet-splitview", flag_descriptions::kDisableTabletSplitViewName,
flag_descriptions::kDisableTabletSplitViewDescription, kOsCrOS,
SINGLE_VALUE_TYPE(ash::switches::kAshDisableTabletSplitView)},
......
......@@ -6,9 +6,7 @@
#include <utility>
#include "ash/public/cpp/ash_switches.h"
#include "ash/public/interfaces/constants.mojom.h"
#include "base/command_line.h"
#include "chrome/browser/ui/ash/tablet_mode_client_observer.h"
#include "content/public/common/service_manager_connection.h"
#include "services/service_manager/public/cpp/connector.h"
......@@ -19,10 +17,7 @@ TabletModeClient* g_tablet_mode_client_instance = nullptr;
} // namespace
TabletModeClient::TabletModeClient()
: auto_hide_title_bars_(!base::CommandLine::ForCurrentProcess()->HasSwitch(
ash::switches::kAshDisableTabletAutohideTitlebars)),
binding_(this) {
TabletModeClient::TabletModeClient() : binding_(this) {
DCHECK(!g_tablet_mode_client_instance);
g_tablet_mode_client_instance = this;
}
......
......@@ -29,7 +29,6 @@ class TabletModeClient : public ash::mojom::TabletModeClient {
static TabletModeClient* Get();
bool tablet_mode_enabled() const { return tablet_mode_enabled_; }
bool auto_hide_title_bars() const { return auto_hide_title_bars_; }
// Adds the observer and immediately triggers it with the initial state.
void AddObserver(TabletModeClientObserver* observer);
......@@ -48,9 +47,6 @@ class TabletModeClient : public ash::mojom::TabletModeClient {
bool tablet_mode_enabled_ = false;
// Whether title bars should be shown be auto hidden in tablet mode.
const bool auto_hide_title_bars_;
// Binds to the client interface in ash.
mojo::Binding<ash::mojom::TabletModeClient> binding_;
......
......@@ -605,6 +605,6 @@ bool ChromeNativeAppWindowViewsAuraAsh::ShouldUseImmersiveMode() const {
// mode.
// TODO(sammiequon): Investigate whether we should check resizability using
// WindowState instead of CanResize.
return client && client->tablet_mode_enabled() &&
client->auto_hide_title_bars() && CanResize() && !IsMinimized();
return client && client->tablet_mode_enabled() && CanResize() &&
!IsMinimized();
}
......@@ -436,8 +436,7 @@ void BrowserNonClientFrameViewAsh::OnTabletModeToggled(bool enabled) {
// minimized are still put in immersive mode, since they may still be
// visible but not activated due to something transparent and/or not
// fullscreen (ie. fullscreen launcher).
if (TabletModeClient::Get()->auto_hide_title_bars() &&
!frame()->IsFullscreen() && !browser_view()->IsBrowserTypeNormal() &&
if (!frame()->IsFullscreen() && !browser_view()->IsBrowserTypeNormal() &&
!frame()->IsMinimized()) {
browser_view()->immersive_mode_controller()->SetEnabled(true);
return;
......@@ -445,8 +444,7 @@ void BrowserNonClientFrameViewAsh::OnTabletModeToggled(bool enabled) {
} else {
// Exit immersive mode if the feature is enabled and the widget is not in
// fullscreen mode.
if (TabletModeClient::Get()->auto_hide_title_bars() &&
!frame()->IsFullscreen() && !browser_view()->IsBrowserTypeNormal()) {
if (!frame()->IsFullscreen() && !browser_view()->IsBrowserTypeNormal()) {
browser_view()->immersive_mode_controller()->SetEnabled(false);
return;
}
......
......@@ -163,8 +163,7 @@ bool ImmersiveModeControllerAsh::ShouldStayImmersiveAfterExitingFullscreen() {
return false;
return !browser_view_->IsBrowserTypeNormal() &&
TabletModeClient::Get()->tablet_mode_enabled() &&
TabletModeClient::Get()->auto_hide_title_bars();
TabletModeClient::Get()->tablet_mode_enabled();
}
views::Widget* ImmersiveModeControllerAsh::GetRevealWidget() {
......@@ -179,8 +178,7 @@ void ImmersiveModeControllerAsh::OnWidgetActivationChanged(
// TODO(crbug.com/760811): Support tablet mode in mash.
if (ash_util::IsRunningInMash() ||
!(TabletModeClient::Get()->tablet_mode_enabled() &&
TabletModeClient::Get()->auto_hide_title_bars())) {
!TabletModeClient::Get()->tablet_mode_enabled()) {
return;
}
......
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