Commit c859df69 authored by Xiaoqian Dai's avatar Xiaoqian Dai Committed by Commit Bot

Disable window dragging from top and tab dragging in tablet mode...

if mohnstrudel (#webui-tab-strip) is enabled.

Mohnstrudel (#webui-tab-strip) will enabled on krane from M81 and other
boards from M82. So window dragging from top and tab dragging will be
disabled on krane from M81 and other boards from M82.

Bug: 1041928
Change-Id: I1b071a190a669374906ff6ec16493dbec879d2d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031668Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Xiaoqian Dai <xdai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737046}
parent 7cba1241
...@@ -231,5 +231,20 @@ bool IsDisplayChangeModalEnabled() { ...@@ -231,5 +231,20 @@ bool IsDisplayChangeModalEnabled() {
return base::FeatureList::IsEnabled(kDisplayChangeModal); return base::FeatureList::IsEnabled(kDisplayChangeModal);
} }
namespace {
// The boolean flag indicating if "WebUITabStrip" feature is enabled in Chrome.
bool g_webui_tab_strip_enabled = false;
} // namespace
void SetWebUITabStripEnabled(bool enabled) {
g_webui_tab_strip_enabled = enabled;
}
bool IsWebUITabStripEnabled() {
return g_webui_tab_strip_enabled;
}
} // namespace features } // namespace features
} // namespace ash } // namespace ash
...@@ -191,6 +191,11 @@ ASH_PUBLIC_EXPORT bool IsHideShelfControlsInTabletModeEnabled(); ...@@ -191,6 +191,11 @@ ASH_PUBLIC_EXPORT bool IsHideShelfControlsInTabletModeEnabled();
ASH_PUBLIC_EXPORT bool IsDisplayChangeModalEnabled(); ASH_PUBLIC_EXPORT bool IsDisplayChangeModalEnabled();
// These two functions are supposed to be temporary functions to set or get
// whether "WebUITabStrip" feature is enabled from Chrome.
ASH_PUBLIC_EXPORT void SetWebUITabStripEnabled(bool enabled);
ASH_PUBLIC_EXPORT bool IsWebUITabStripEnabled();
} // namespace features } // namespace features
} // namespace ash } // namespace ash
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h" #include "ash/root_window_controller.h"
#include "ash/screen_util.h" #include "ash/screen_util.h"
...@@ -59,6 +60,12 @@ std::unique_ptr<WindowResizer> CreateWindowResizerForTabletMode( ...@@ -59,6 +60,12 @@ std::unique_ptr<WindowResizer> CreateWindowResizerForTabletMode(
const gfx::PointF& point_in_parent, const gfx::PointF& point_in_parent,
int window_component, int window_component,
::wm::WindowMoveSource source) { ::wm::WindowMoveSource source) {
// Window dragging from top and tab dragging are disabled if "WebUITabStrip"
// feature is enabled. "WebUITabStrip" will be enabled on 81 for Krane and on
// 82 for all other boards.
if (features::IsWebUITabStripEnabled())
return nullptr;
WindowState* window_state = WindowState::Get(window); WindowState* window_state = WindowState::Get(window);
// Only maximized/fullscreen/snapped window can be dragged from the top of // Only maximized/fullscreen/snapped window can be dragged from the top of
// the screen. // the screen.
......
...@@ -6,11 +6,13 @@ ...@@ -6,11 +6,13 @@
#include <utility> #include <utility>
#include "ash/public/cpp/ash_features.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/shell_init_params.h" #include "ash/shell_init_params.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/ash/chrome_shell_delegate.h" #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
#include "chrome/browser/ui/ash/keyboard/chrome_keyboard_ui_factory.h" #include "chrome/browser/ui/ash/keyboard/chrome_keyboard_ui_factory.h"
#include "chrome/browser/ui/ui_features.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "content/public/browser/context_factory.h" #include "content/public/browser/context_factory.h"
#include "ui/aura/window_tree_host.h" #include "ui/aura/window_tree_host.h"
...@@ -37,6 +39,10 @@ void CreateShell() { ...@@ -37,6 +39,10 @@ void CreateShell() {
AshShellInit::AshShellInit() { AshShellInit::AshShellInit() {
CreateShell(); CreateShell();
ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
// Push browser feature flags to ash.
ash::features::SetWebUITabStripEnabled(
base::FeatureList::IsEnabled(features::kWebUITabStrip));
} }
AshShellInit::~AshShellInit() { AshShellInit::~AshShellInit() {
......
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