[ash-md] Improves smoothness with many windows in overview
Experimentally, most of the animation cost was coming from having window
shapes (used to mask the window header) and from using rounded rectangle
masks.
This CL disables both those performance hogs when there are more than
certain number of windows in the overview mode (controlled via flags).
Default is set to hardcoded 10.
It also makes sure that window controls (minimize / resize / close) are
hidden when in overview mode for custom and panel frames.
New flags are introduced:
--ash-max-previews-to-use-mask=<number>
Maximum number of preview windows in overview mode that can use masks to
hide window headers and use rounded corners. Use -1 to set to unlimited.
--ash-max-previews-to-use-shape=<number>
Maximum number of preview windows in overview mode that can use shapes to
hide window headers. Use -1 to set to unlimited.
BUG=626851
BUG=624608
Review-Url: https://codereview.chromium.org/2146323004
Cr-Commit-Position: refs/heads/master@{#406286}
diff --git a/ash/common/ash_switches.cc b/ash/common/ash_switches.cc
index 6cf8ab4..3211e2a 100644
--- a/ash/common/ash_switches.cc
+++ b/ash/common/ash_switches.cc
@@ -98,6 +98,16 @@
const char kAshMaterialDesignEnabled[] = "enabled";
const char kAshMaterialDesignExperimental[] = "experimental";
+// Specifies a maximum number of preview windows in overview mode that still
+// allows using mask layers to hide the original window header and use rounded
+// corners.
+const char kAshMaxWindowsToUseMaskInOverview[] = "ash-max-previews-to-use-mask";
+
+// Specifies a maximum number of preview windows in overview mode that still
+// allows using alpha shapes to hide the original window header.
+const char kAshMaxWindowsToUseShapeInOverview[] =
+ "ash-max-previews-to-use-shape";
+
// Specifies the layout mode and offsets for the secondary display for
// testing. The format is "<t|r|b|l>,<offset>" where t=TOP, r=RIGHT,
// b=BOTTOM and L=LEFT. For example, 'r,-100' means the secondary display
diff --git a/ash/common/ash_switches.h b/ash/common/ash_switches.h
index 21540a99..4c06f7e 100644
--- a/ash/common/ash_switches.h
+++ b/ash/common/ash_switches.h
@@ -44,6 +44,8 @@
ASH_EXPORT extern const char kAshMaterialDesignDisabled[];
ASH_EXPORT extern const char kAshMaterialDesignEnabled[];
ASH_EXPORT extern const char kAshMaterialDesignExperimental[];
+ASH_EXPORT extern const char kAshMaxWindowsToUseMaskInOverview[];
+ASH_EXPORT extern const char kAshMaxWindowsToUseShapeInOverview[];
ASH_EXPORT extern const char kAshSecondaryDisplayLayout[];
ASH_EXPORT extern const char kAshTouchHud[];
ASH_EXPORT extern const char kAshUseFirstDisplayAsInternal[];
diff --git a/ash/common/wm/overview/scoped_transform_overview_window.cc b/ash/common/wm/overview/scoped_transform_overview_window.cc
index a2abe5d..8e5cf5fd 100644
--- a/ash/common/wm/overview/scoped_transform_overview_window.cc
+++ b/ash/common/wm/overview/scoped_transform_overview_window.cc
@@ -180,10 +180,11 @@
class ScopedTransformOverviewWindow::OverviewContentMask
: public ui::LayerDelegate {
public:
- explicit OverviewContentMask(float radius);
+ explicit OverviewContentMask();
~OverviewContentMask() override;
void set_radius(float radius) { radius_ = radius; }
+ void set_inset(int inset) { inset_ = inset; }
ui::Layer* layer() { return &layer_; }
// Overridden from LayerDelegate.
@@ -195,13 +196,13 @@
private:
ui::Layer layer_;
float radius_;
+ int inset_;
DISALLOW_COPY_AND_ASSIGN(OverviewContentMask);
};
-ScopedTransformOverviewWindow::OverviewContentMask::OverviewContentMask(
- float radius)
- : layer_(ui::LAYER_TEXTURED), radius_(radius) {
+ScopedTransformOverviewWindow::OverviewContentMask::OverviewContentMask()
+ : layer_(ui::LAYER_TEXTURED), radius_(0), inset_(0) {
layer_.set_delegate(this);
}
@@ -213,6 +214,7 @@
const ui::PaintContext& context) {
ui::PaintRecorder recorder(context, layer()->size());
gfx::Rect bounds(layer()->bounds().size());
+ bounds.Inset(0, inset_, 0, 0);
// Tile a window into an area, rounding the bottom corners.
const SkRect rect = gfx::RectToSkRect(bounds);
@@ -268,7 +270,8 @@
ScopedAnimationSettings animation_settings_list;
BeginScopedAnimation(OverviewAnimationType::OVERVIEW_ANIMATION_RESTORE_WINDOW,
&animation_settings_list);
- SetTransform(window()->GetRootWindow(), original_transform_, 0);
+ SetTransform(window()->GetRootWindow(), original_transform_,
+ false /* use_mask */, false /* use_shape */, 0);
std::unique_ptr<ScopedOverviewAnimationSettings> animation_settings =
CreateScopedOverviewAnimationSettings(
@@ -417,30 +420,39 @@
void ScopedTransformOverviewWindow::SetTransform(
WmWindow* root_window,
const gfx::Transform& transform,
+ bool use_mask,
+ bool use_shape,
float radius) {
DCHECK(overview_started_);
if (ash::MaterialDesignController::IsOverviewMaterial() &&
&transform != &original_transform_) {
- if (!mask_) {
- mask_.reset(new OverviewContentMask(radius));
+ if (use_mask && !mask_) {
+ mask_.reset(new OverviewContentMask());
mask_->layer()->SetFillsBoundsOpaquely(false);
window()->GetLayer()->SetMaskLayer(mask_->layer());
}
- gfx::Rect bounds(GetTargetBoundsInScreen().size());
- mask_->layer()->SetBounds(bounds);
- mask_->set_radius(radius);
- window()->GetLayer()->SchedulePaint(bounds);
-
if (!determined_original_window_shape_) {
determined_original_window_shape_ = true;
SkRegion* window_shape = window()->GetLayer()->alpha_shape();
if (!original_window_shape_ && window_shape)
original_window_shape_.reset(new SkRegion(*window_shape));
}
+ gfx::Rect bounds(GetTargetBoundsInScreen().size());
const int inset =
- window()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET);
- if (inset > 0) {
+ (use_mask || use_shape)
+ ? window()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET)
+ : 0;
+ if (mask_) {
+ // Mask layer is used both to hide the window header and to use rounded
+ // corners. Its layout needs to be update when setting a transform.
+ mask_->layer()->SetBounds(bounds);
+ mask_->set_inset(inset);
+ mask_->set_radius(radius);
+ window()->GetLayer()->SchedulePaint(bounds);
+ } else if (inset > 0) {
+ // Alpha shape is only used to to hide the window header and only when
+ // not using a mask layer.
bounds.Inset(0, inset, 0, 0);
SkRegion* region = new SkRegion;
region->setRect(RectToSkIRect(bounds));
diff --git a/ash/common/wm/overview/scoped_transform_overview_window.h b/ash/common/wm/overview/scoped_transform_overview_window.h
index a32974a..6f8a904a 100644
--- a/ash/common/wm/overview/scoped_transform_overview_window.h
+++ b/ash/common/wm/overview/scoped_transform_overview_window.h
@@ -105,9 +105,14 @@
// Applies the |transform| to the overview window and all of its transient
// children. With Material Design creates a mask layer with the bottom edge
- // using rounded corners of |radius|.
+ // using rounded corners of |radius|. When |use_mask| is set, hides the
+ // original window header and uses rounded rectangle mask which may be
+ // resource-intensive. When |use_shape| is set and |use_mask| is not, uses
+ // SetAlphaShape to mask the header.
void SetTransform(WmWindow* root_window,
const gfx::Transform& transform,
+ bool use_mask,
+ bool use_shape,
float radius);
// Set's the opacity of the managed windows.
diff --git a/ash/common/wm/overview/window_grid.cc b/ash/common/wm/overview/window_grid.cc
index d3b9265..9652e5d 100644
--- a/ash/common/wm/overview/window_grid.cc
+++ b/ash/common/wm/overview/window_grid.cc
@@ -30,6 +30,7 @@
#include "base/command_line.h"
#include "base/i18n/string_search.h"
#include "base/memory/scoped_vector.h"
+#include "base/strings/string_number_conversions.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/pathops/SkPathOps.h"
#include "ui/compositor/layer_animation_observer.h"
@@ -73,6 +74,10 @@
// landscape orientation).
const int kMinCardsMajor = 3;
+// Hiding window headers can be resource intensive. Only hide the headers when
+// the number of windows in this grid is less or equal than this number.
+const int kMaxWindowsCountToHideHeader = 10;
+
const int kOverviewSelectorTransitionMilliseconds = 250;
// The color and opacity of the screen shield in overview.
@@ -452,6 +457,34 @@
void WindowGrid::PositionWindowsMD(bool animate) {
if (window_list_.empty())
return;
+
+ const int kUnlimited = -1;
+ const size_t windows_count = window_list_.size();
+ const base::CommandLine* command_line =
+ base::CommandLine::ForCurrentProcess();
+ int windows_to_use_masks = kMaxWindowsCountToHideHeader;
+ if (command_line->HasSwitch(switches::kAshMaxWindowsToUseMaskInOverview) &&
+ (!base::StringToInt(command_line->GetSwitchValueASCII(
+ switches::kAshMaxWindowsToUseMaskInOverview),
+ &windows_to_use_masks) ||
+ windows_to_use_masks <= kUnlimited)) {
+ windows_to_use_masks = kMaxWindowsCountToHideHeader;
+ }
+ int windows_to_use_shapes = kUnlimited;
+ if (command_line->HasSwitch(switches::kAshMaxWindowsToUseShapeInOverview) &&
+ (!base::StringToInt(command_line->GetSwitchValueASCII(
+ switches::kAshMaxWindowsToUseShapeInOverview),
+ &windows_to_use_shapes) ||
+ windows_to_use_shapes <= kUnlimited)) {
+ windows_to_use_shapes = kUnlimited;
+ }
+ WindowSelectorItem::set_use_mask(windows_to_use_masks <= kUnlimited ||
+ static_cast<int>(windows_count) <=
+ windows_to_use_masks);
+ WindowSelectorItem::set_use_shape(windows_to_use_shapes <= kUnlimited ||
+ static_cast<int>(windows_count) <=
+ windows_to_use_shapes);
+
gfx::Rect total_bounds =
root_window_->ConvertRectToScreen(wm::GetDisplayWorkAreaBoundsInParent(
root_window_->GetChildByShellWindowId(
@@ -560,7 +593,7 @@
}
// Position the windows centering the left-aligned rows vertically.
gfx::Vector2d offset(0, (total_bounds.bottom() - max_bottom) / 2);
- for (size_t i = 0; i < window_list_.size(); ++i) {
+ for (size_t i = 0; i < windows_count; ++i) {
window_list_[i]->SetBounds(
rects[i] + offset,
animate
diff --git a/ash/common/wm/overview/window_selector_item.cc b/ash/common/wm/overview/window_selector_item.cc
index 83725e8..3fb0ea66 100644
--- a/ash/common/wm/overview/window_selector_item.cc
+++ b/ash/common/wm/overview/window_selector_item.cc
@@ -106,7 +106,7 @@
// Calculates the |window| bounds after being transformed to the selector's
// space. The returned Rect is in virtual screen coordinates.
-gfx::Rect GetTransformedBounds(WmWindow* window) {
+gfx::Rect GetTransformedBounds(WmWindow* window, bool hide_header) {
gfx::RectF bounds(
window->GetRootWindow()->ConvertRectToScreen(window->GetTargetBounds()));
gfx::Transform new_transform = TransformAboutPivot(
@@ -116,7 +116,7 @@
// With Material Design the preview title is shown above the preview window.
// Hide the window header for apps or browser windows with no tabs (web apps)
// to avoid showing both the window header and the preview title.
- if (ash::MaterialDesignController::IsOverviewMaterial()) {
+ if (ash::MaterialDesignController::IsOverviewMaterial() && hide_header) {
gfx::RectF header_bounds(bounds);
header_bounds.set_height(
window->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET));
@@ -215,6 +215,9 @@
} // namespace
+bool WindowSelectorItem::use_mask_ = false;
+bool WindowSelectorItem::use_shape_ = false;
+
WindowSelectorItem::OverviewLabelButton::OverviewLabelButton(
views::ButtonListener* listener,
const base::string16& text)
@@ -457,9 +460,12 @@
float WindowSelectorItem::GetItemScale(const gfx::Size& size) {
gfx::Size inset_size(size.width(), size.height() - 2 * kWindowMarginMD);
+ const int header_inset =
+ hide_header()
+ ? GetWindow()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET)
+ : 0;
return ScopedTransformOverviewWindow::GetItemScale(
- GetWindow()->GetTargetBounds().size(), inset_size,
- GetWindow()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET),
+ GetWindow()->GetTargetBounds().size(), inset_size, header_inset,
close_button_->GetPreferredSize().height());
}
@@ -476,8 +482,10 @@
int top_view_inset = 0;
int title_height = 0;
if (ash::MaterialDesignController::IsOverviewMaterial()) {
- top_view_inset =
- GetWindow()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET);
+ if (hide_header()) {
+ top_view_inset =
+ GetWindow()->GetIntProperty(WmWindowProperty::TOP_VIEW_INSET);
+ }
title_height = close_button_->GetPreferredSize().height();
}
gfx::Rect selector_item_bounds =
@@ -491,7 +499,7 @@
// before the transform. Dividing by scale factor obtains the corner radius
// which when scaled will yield |kLabelBackgroundRadius|.
transform_window_.SetTransform(
- root_window_, transform,
+ root_window_, transform, use_mask_, use_shape_,
(kLabelBackgroundRadius / GetItemScale(target_bounds.size())));
transform_window_.set_overview_transform(transform);
}
@@ -589,8 +597,8 @@
void WindowSelectorItem::UpdateHeaderLayout(
OverviewAnimationType animation_type) {
- gfx::Rect transformed_window_bounds =
- root_window_->ConvertRectFromScreen(GetTransformedBounds(GetWindow()));
+ gfx::Rect transformed_window_bounds = root_window_->ConvertRectFromScreen(
+ GetTransformedBounds(GetWindow(), hide_header()));
if (ash::MaterialDesignController::IsOverviewMaterial()) {
gfx::Rect label_rect(close_button_->GetPreferredSize());
diff --git a/ash/common/wm/overview/window_selector_item.h b/ash/common/wm/overview/window_selector_item.h
index a275e1f6..f533a4a 100644
--- a/ash/common/wm/overview/window_selector_item.h
+++ b/ash/common/wm/overview/window_selector_item.h
@@ -114,6 +114,8 @@
bool dimmed() const { return dimmed_; }
const gfx::Rect& target_bounds() const { return target_bounds_; }
+ static void set_use_mask(bool use_mask) { use_mask_ = use_mask; }
+ static void set_use_shape(bool use_shape) { use_shape_ = use_shape; }
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
@@ -154,6 +156,8 @@
// Updates the close buttons accessibility name.
void UpdateCloseButtonAccessibilityName();
+ static bool hide_header() { return use_mask_ || use_shape_; }
+
// True if the item is being shown in the overview, false if it's being
// filtered.
bool dimmed_;
@@ -203,6 +207,16 @@
// Guaranteed to be non-null for the lifetime of |this|.
WindowSelector* window_selector_;
+ // If true, mask the original window header while in overview and make corners
+ // rounded using a mask layer. This has performance implications so it can be
+ // disabled when there are many windows.
+ static bool use_mask_;
+
+ // If true, hide the original window header while in overview using alpha
+ // shape. This has performance implications so it can be disabled when there
+ // are many windows.
+ static bool use_shape_;
+
DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem);
};
diff --git a/ash/frame/custom_frame_view_ash.cc b/ash/frame/custom_frame_view_ash.cc
index c188b994..c0f057c 100644
--- a/ash/frame/custom_frame_view_ash.cc
+++ b/ash/frame/custom_frame_view_ash.cc
@@ -9,6 +9,7 @@
#include "ash/aura/wm_window_aura.h"
#include "ash/common/ash_switches.h"
+#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/shell_observer.h"
#include "ash/common/wm/window_state.h"
@@ -165,6 +166,8 @@
void ChildPreferredSizeChanged(views::View* child) override;
// ShellObserver:
+ void OnOverviewModeStarting() override;
+ void OnOverviewModeEnded() override;
void OnMaximizeModeStarted() override;
void OnMaximizeModeEnded() override;
@@ -310,6 +313,16 @@
///////////////////////////////////////////////////////////////////////////////
// CustomFrameViewAsh::HeaderView, ShellObserver overrides:
+void CustomFrameViewAsh::HeaderView::OnOverviewModeStarting() {
+ if (ash::MaterialDesignController::IsOverviewMaterial())
+ caption_button_container_->SetVisible(false);
+}
+
+void CustomFrameViewAsh::HeaderView::OnOverviewModeEnded() {
+ if (ash::MaterialDesignController::IsOverviewMaterial())
+ caption_button_container_->SetVisible(true);
+}
+
void CustomFrameViewAsh::HeaderView::OnMaximizeModeStarted() {
caption_button_container_->UpdateSizeButtonVisibility();
parent()->Layout();
diff --git a/ash/wm/panels/panel_frame_view.cc b/ash/wm/panels/panel_frame_view.cc
index 85846f4..129d9010 100644
--- a/ash/wm/panels/panel_frame_view.cc
+++ b/ash/wm/panels/panel_frame_view.cc
@@ -4,6 +4,8 @@
#include "ash/wm/panels/panel_frame_view.h"
+#include "ash/common/material_design/material_design_controller.h"
+#include "ash/common/wm_shell.h"
#include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
#include "ash/frame/default_header_painter.h"
#include "ash/frame/frame_border_hit_test_controller.h"
@@ -29,9 +31,12 @@
DCHECK(!frame_->widget_delegate()->CanMaximize());
if (frame_type != FRAME_NONE)
InitHeaderPainter();
+ WmShell::Get()->AddShellObserver(this);
}
-PanelFrameView::~PanelFrameView() {}
+PanelFrameView::~PanelFrameView() {
+ WmShell::Get()->RemoveShellObserver(this);
+}
void PanelFrameView::SetFrameColors(SkColor active_frame_color,
SkColor inactive_frame_color) {
@@ -105,6 +110,19 @@
void PanelFrameView::SizeConstraintsChanged() {}
+gfx::Rect PanelFrameView::GetBoundsForClientView() const {
+ gfx::Rect client_bounds = bounds();
+ client_bounds.Inset(0, NonClientTopBorderHeight(), 0, 0);
+ return client_bounds;
+}
+
+gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds(
+ const gfx::Rect& client_bounds) const {
+ gfx::Rect window_bounds = client_bounds;
+ window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0);
+ return window_bounds;
+}
+
int PanelFrameView::NonClientHitTest(const gfx::Point& point) {
if (!header_painter_)
return HTNOWHERE;
@@ -124,17 +142,17 @@
header_painter_->PaintHeader(canvas, header_mode);
}
-gfx::Rect PanelFrameView::GetBoundsForClientView() const {
- gfx::Rect client_bounds = bounds();
- client_bounds.Inset(0, NonClientTopBorderHeight(), 0, 0);
- return client_bounds;
+///////////////////////////////////////////////////////////////////////////////
+// PanelFrameView, ShellObserver overrides:
+
+void PanelFrameView::OnOverviewModeStarting() {
+ if (ash::MaterialDesignController::IsOverviewMaterial())
+ caption_button_container_->SetVisible(false);
}
-gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const {
- gfx::Rect window_bounds = client_bounds;
- window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0);
- return window_bounds;
+void PanelFrameView::OnOverviewModeEnded() {
+ if (ash::MaterialDesignController::IsOverviewMaterial())
+ caption_button_container_->SetVisible(true);
}
} // namespace ash
diff --git a/ash/wm/panels/panel_frame_view.h b/ash/wm/panels/panel_frame_view.h
index 0ecd7e7d..1c0547a 100644
--- a/ash/wm/panels/panel_frame_view.h
+++ b/ash/wm/panels/panel_frame_view.h
@@ -8,6 +8,7 @@
#include <memory>
#include "ash/ash_export.h"
+#include "ash/common/shell_observer.h"
#include "base/macros.h"
#include "ui/views/window/non_client_view.h"
@@ -20,7 +21,8 @@
class FrameCaptionButtonContainerView;
class FrameBorderHitTestController;
-class ASH_EXPORT PanelFrameView : public views::NonClientFrameView {
+class ASH_EXPORT PanelFrameView : public views::NonClientFrameView,
+ public ShellObserver {
public:
// Internal class name.
static const char kViewClassName[];
@@ -34,7 +36,7 @@
// will have some transparency added when the frame is drawn.
void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color);
- // Overridden from views::View:
+ // views::View:
const char* GetClassName() const override;
private:
@@ -43,7 +45,7 @@
// Height from top of window to top of client area.
int NonClientTopBorderHeight() const;
- // Overridden from views::NonClientFrameView:
+ // views::NonClientFrameView:
gfx::Rect GetBoundsForClientView() const override;
gfx::Rect GetWindowBoundsForClientBounds(
const gfx::Rect& client_bounds) const override;
@@ -54,11 +56,15 @@
void UpdateWindowTitle() override;
void SizeConstraintsChanged() override;
- // Overridden from views::View:
+ // views::View:
gfx::Size GetMinimumSize() const override;
void Layout() override;
void OnPaint(gfx::Canvas* canvas) override;
+ // ShellObserver:
+ void OnOverviewModeStarting() override;
+ void OnOverviewModeEnded() override;
+
// Child View class describing the panel's title bar behavior
// and buttons, owned by the view hierarchy
views::Widget* frame_;
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 4a6cc01..ba4a90fc 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5703,6 +5703,48 @@
<message name="IDS_FLAGS_ASH_MD_EXPERIMENTAL" desc="The value of the Material Design in Chrome OS UI flag that controls experimental features.">
Experimental
</message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_NAME" desc="Title of the flag which sets a limit for how many preview windows in overview can use masks.">
+ Maximum number of windows in overview that can use masks.
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_DESCRIPTION" desc="Description of the flag which sets a limit for how many preview windows in overview can use masks.">
+ Maximum number of preview windows in overview mode that can use masks to hide window headers and use rounded corners.
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_UNLIMITED" desc="The value that does not set a limit for how many preview windows in overview can use masks to hide headers and use rounded corners.">
+ Unlimited
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_ZERO" desc="The value that sets a limit for how many preview windows in overview can use masks to hide headers and use rounded corners to 0.">
+ 0
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_FIVE" desc="The value that sets a limit for how many preview windows in overview can use masks to hide headers and use rounded corners to 5.">
+ 5
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_TEN" desc="The value that sets a limit for how many preview windows in overview can use masks to hide headers and use rounded corners to 10.">
+ 10
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_FIFTEEN" desc="The value that sets a limit for how many preview windows in overview can use masks to hide headers and use rounded corners to 15.">
+ 15
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_NAME" desc="Title of the flag which sets a limit for how many preview windows in overview can use shapes.">
+ Maximum number of windows in overview that can use shapes.
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_DESCRIPTION" desc="Description of the flag which sets a limit for how many preview windows in overview can use shapes.">
+ Maximum number of preview windows in overview mode that can use shapes to hide window headers.
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_UNLIMITED" desc="The value that does not set a limit for how many preview windows in overview can use shapes to hide headers.">
+ Unlimited
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_ZERO" desc="The value that sets a limit for how many preview windows in overview can use shapes to hide headers to 0.">
+ 0
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_FIVE" desc="The value that sets a limit for how many preview windows in overview can use shapes to hide headers to 5.">
+ 5
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_TEN" desc="The value that sets a limit for how many preview windows in overview can use shapes to hide headers to 10.">
+ 10
+ </message>
+ <message name="IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_FIFTEEN" desc="The value that sets a limit for how many preview windows in overview can use shapes to hide headers to 15.">
+ 15
+ </message>
<message name="IDS_FLAGS_ASH_MAXIMIZE_MODE_WINDOW_BACKDROP_NAME" desc="Title for the flag which can be used for window backdrops in TouchView.">
Window backdrops in TouchView
</message>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 9a28fe4..4e6d852 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -378,6 +378,34 @@
ash::switches::kAshMaterialDesignExperimental},
};
+const FeatureEntry::Choice kAshMaxWindowsToUseMaskInOverviewChoices[] = {
+ {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_UNLIMITED,
+ ash::switches::kAshMaxWindowsToUseMaskInOverview, "-1"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_ZERO,
+ ash::switches::kAshMaxWindowsToUseMaskInOverview, "0"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_FIVE,
+ ash::switches::kAshMaxWindowsToUseMaskInOverview, "5"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_TEN,
+ ash::switches::kAshMaxWindowsToUseMaskInOverview, "10"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_FIFTEEN,
+ ash::switches::kAshMaxWindowsToUseMaskInOverview, "15"},
+};
+
+const FeatureEntry::Choice kAshMaxWindowsToUseShapeInOverviewChoices[] = {
+ {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_UNLIMITED,
+ ash::switches::kAshMaxWindowsToUseShapeInOverview, "-1"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_ZERO,
+ ash::switches::kAshMaxWindowsToUseShapeInOverview, "0"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_FIVE,
+ ash::switches::kAshMaxWindowsToUseShapeInOverview, "5"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_TEN,
+ ash::switches::kAshMaxWindowsToUseShapeInOverview, "10"},
+ {IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_FIFTEEN,
+ ash::switches::kAshMaxWindowsToUseShapeInOverview, "15"},
+};
+
const FeatureEntry::Choice kAshMaterialDesignInkDropAnimationSpeed[] = {
{IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", ""},
{IDS_FLAGS_MATERIAL_DESIGN_INK_DROP_ANIMATION_FAST,
@@ -777,9 +805,8 @@
IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_NAME,
IDS_FLAGS_EXPERIMENTAL_WEB_PLATFORM_FEATURES_DESCRIPTION, kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableExperimentalWebPlatformFeatures)},
- {"enable-web-bluetooth", // FLAGS:RECORD_UMA
- IDS_FLAGS_WEB_BLUETOOTH_NAME,
- IDS_FLAGS_WEB_BLUETOOTH_DESCRIPTION,
+ {"enable-web-bluetooth", // FLAGS:RECORD_UMA
+ IDS_FLAGS_WEB_BLUETOOTH_NAME, IDS_FLAGS_WEB_BLUETOOTH_DESCRIPTION,
kOsCrOS | kOsMac | kOsAndroid | kOsLinux,
SINGLE_VALUE_TYPE(switches::kEnableWebBluetooth)},
#if defined(ENABLE_EXTENSIONS)
@@ -953,6 +980,18 @@
ash::switches::kAshEnableStableOverviewOrder,
ash::switches::kAshDisableStableOverviewOrder),
},
+ {
+ "ash-max-previews-to-use-mask",
+ IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_NAME,
+ IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_MASK_DESCRIPTION, kOsCrOS,
+ MULTI_VALUE_TYPE(kAshMaxWindowsToUseMaskInOverviewChoices),
+ },
+ {
+ "ash-max-previews-to-use-shape",
+ IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_NAME,
+ IDS_FLAGS_ASH_MAX_PREVIEWS_TO_USE_SHAPE_DESCRIPTION, kOsCrOS,
+ MULTI_VALUE_TYPE(kAshMaxWindowsToUseShapeInOverviewChoices),
+ },
#endif // defined(USE_ASH)
#if defined(OS_CHROMEOS)
{"material-design-ink-drop-animation-speed",
@@ -1814,8 +1853,7 @@
#if defined(ENABLE_EXTENSIONS)
{"tab-for-desktop-share", IDS_FLAG_DISABLE_TAB_FOR_DESKTOP_SHARE,
IDS_FLAG_DISABLE_TAB_FOR_DESKTOP_SHARE_DESCRIPTION, kOsAll,
- SINGLE_VALUE_TYPE(
- extensions::switches::kDisableTabForDesktopShare)},
+ SINGLE_VALUE_TYPE(extensions::switches::kDisableTabForDesktopShare)},
{"disable-desktop-capture-picker-new-ui",
IDS_FLAG_DISABLE_DESKTOP_CAPTURE_PICKER_NEW_UI,
IDS_FLAG_DISABLE_DESKTOP_CAPTURE_PICKER_NEW_UI_DESCRIPTION, kOsAll,
@@ -1909,8 +1947,7 @@
{"important-sites-in-cbd", IDS_FLAGS_IMPORTANT_SITES_IN_CBD_NAME,
IDS_FLAGS_IMPORTANT_SITES_IN_CBD_DESCRIPTION, kOsAndroid,
FEATURE_VALUE_TYPE(chrome::android::kImportantSitesInCBD)},
- {"autoplay-muted-videos",
- IDS_FLAGS_ENABLE_AUTOPLAY_MUTED_VIDEOS_NAME,
+ {"autoplay-muted-videos", IDS_FLAGS_ENABLE_AUTOPLAY_MUTED_VIDEOS_NAME,
IDS_FLAGS_ENABLE_AUTOPLAY_MUTED_VIDEOS_DESCRIPTION, kOsAndroid,
FEATURE_VALUE_TYPE(features::kAutoplayMutedVideos)},
#endif
@@ -1968,8 +2005,8 @@
ENABLE_DISABLE_VALUE_TYPE(chromeos::switches::kEnableFilesQuickView,
chromeos::switches::kDisableFilesQuickView)},
#endif // defined(OS_CHROMEOS)
- // NOTE: Adding new command-line switches requires adding corresponding
- // entries to enum "LoginCustomFlags" in histograms.xml. See note in
+ // NOTE: Adding new command-line switches requires adding corresponding
+ // entries to enum "LoginCustomFlags" in histograms.xml. See note in
// histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
};
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 2e4e1b66..db30d0bc 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -81726,6 +81726,7 @@
<int value="-231922000" label="enable-renderer-mojo-channel"/>
<int value="-206393363" label="enable-scroll-prediction"/>
<int value="-204355195" label="secondary-ui-md"/>
+ <int value="-201208150" label="ash-max-previews-to-use-mask"/>
<int value="-183246373" label="enable-multilingual-spellchecker"/>
<int value="-165756594" label="enable-touch-feedback"/>
<int value="-158549277" label="enable-embeddedsearch-api"/>
@@ -81746,6 +81747,7 @@
<int value="-52483823" label="disable-new-video-renderer"/>
<int value="-52241456" label="enable-single-click-autofill"/>
<int value="-48920737" label="enable-smooth-scrolling"/>
+ <int value="-45063580" label="ash-max-previews-to-use-shape"/>
<int value="-23090520" label="disable-search-button-in-omnibox"/>
<int value="-22544408" label="enable-video-player-chromecast-support"/>
<int value="-13918890" label="disable-download-notification"/>