Commit 06e35791 authored by Eliot Courtney's avatar Eliot Courtney Committed by Commit Bot

Add RoundedCornerDecorator and apply it to Picture-in-Picture windows.

    I tested: 1. open pip window, 2. move around, 3. resize, 4. close,
    5. re-open, 6. close tab destroying the window
    off.

Bug: 841886
Test: Chrome PIP works with rounded corners flag both on and off.
Test: Android PIP window works with rounded corners flag both on and
Change-Id: Iec59abde476d56c58e197b9220ac6ba418801395
Reviewed-on: https://chromium-review.googlesource.com/c/1347969Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Commit-Queue: Eliot Courtney <edcourtney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611957}
parent 67f9bd45
......@@ -92,6 +92,8 @@ component("cpp") {
"power_utils.h",
"remote_shelf_item_delegate.cc",
"remote_shelf_item_delegate.h",
"rounded_corner_decorator.cc",
"rounded_corner_decorator.h",
"scale_utility.cc",
"scale_utility.h",
"session_types.h",
......@@ -133,6 +135,7 @@ component("cpp") {
"//skia/public/interfaces",
"//ui/aura",
"//ui/chromeos/strings",
"//ui/compositor_extra",
"//ui/display",
"//ui/events/devices",
"//ui/message_center/public/cpp",
......@@ -175,6 +178,7 @@ source_set("unit_tests") {
"default_scale_factor_retriever_unittest.cc",
"menu_utils_unittest.cc",
"power_utils_unittest.cc",
"rounded_corner_decorator_unittest.cc",
"shelf_model_unittest.cc",
"shelf_struct_mojom_traits_unittest.cc",
]
......@@ -184,6 +188,7 @@ source_set("unit_tests") {
":test_interfaces",
"//base",
"//testing/gtest",
"//ui/aura:test_support",
"//ui/gfx:test_support",
]
}
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/public/cpp/rounded_corner_decorator.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/compositor/paint_recorder.h"
#include "ui/compositor_extra/shadow.h"
#include "ui/wm/core/shadow_controller.h"
namespace ash {
RoundedCornerDecorator::RoundedCornerDecorator(aura::Window* shadow_window,
aura::Window* layer_window,
ui::Layer* layer,
int radius)
: layer_window_(layer_window), layer_(layer), radius_(radius) {
layer_window_->AddObserver(this);
layer_->AddObserver(this);
Update(layer_->size());
// Update the shadow if necessary.
ui::Shadow* shadow = wm::ShadowController::GetShadowForWindow(shadow_window);
if (shadow)
shadow->SetRoundedCornerRadius(radius_);
}
RoundedCornerDecorator::~RoundedCornerDecorator() {
Shutdown();
}
bool RoundedCornerDecorator::IsValid() {
return !!layer_;
}
void RoundedCornerDecorator::OnPaintLayer(const ui::PaintContext& context) {
cc::PaintFlags flags;
flags.setAlpha(255);
flags.setAntiAlias(true);
flags.setStyle(cc::PaintFlags::kFill_Style);
SkScalar radii[8] = {radius_, radius_, // top-left
radius_, radius_, // top-right
radius_, radius_, // bottom-right
radius_, radius_}; // bottom-left
SkPath path;
const gfx::Size size = mask_layer_->size();
path.addRoundRect(gfx::RectToSkRect(gfx::Rect(size)), radii);
ui::PaintRecorder recorder(context, size);
recorder.canvas()->DrawPath(path, flags);
}
void RoundedCornerDecorator::LayerDestroyed(ui::Layer* layer) {
Shutdown();
}
void RoundedCornerDecorator::OnWindowBoundsChanged(
aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
ui::PropertyChangeReason reason) {
Update(new_bounds.size());
}
void RoundedCornerDecorator::OnWindowDestroying(aura::Window* window) {
Shutdown();
}
void RoundedCornerDecorator::Update(const gfx::Size& size) {
DCHECK(layer_window_);
DCHECK(layer_);
if (!mask_layer_) {
mask_layer_ = std::make_unique<ui::Layer>(ui::LAYER_TEXTURED);
mask_layer_->set_delegate(this);
mask_layer_->SetFillsBoundsOpaquely(false);
layer_->SetMaskLayer(mask_layer_.get());
}
mask_layer_->SetBounds(gfx::Rect(size));
}
void RoundedCornerDecorator::Shutdown() {
if (!IsValid())
return;
if (layer_->layer_mask_layer() == mask_layer_.get())
layer_->SetMaskLayer(nullptr);
mask_layer_.reset();
layer_->RemoveObserver(this);
layer_window_->RemoveObserver(this);
layer_ = nullptr;
layer_window_ = nullptr;
}
} // namespace ash
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_PUBLIC_CPP_ROUNDED_CORNER_DECORATOR_H_
#define ASH_PUBLIC_CPP_ROUNDED_CORNER_DECORATOR_H_
#include <memory>
#include "ash/public/cpp/ash_public_export.h"
#include "ui/aura/window_observer.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_delegate.h"
#include "ui/compositor/layer_observer.h"
#include "ui/gfx/geometry/size.h"
namespace ash {
constexpr int kPipRoundedCornerRadius = 8;
// Applies rounded corners to the given layer, and modifies the shadow of
// the given window to be rounded.
class ASH_PUBLIC_EXPORT RoundedCornerDecorator : public ui::LayerDelegate,
public ui::LayerObserver,
public aura::WindowObserver {
public:
RoundedCornerDecorator(aura::Window* shadow_window,
aura::Window* layer_window,
ui::Layer* layer,
int radius);
~RoundedCornerDecorator() override;
// Returns true if the rounded corner decorator is still applied to a valid
// layer.
bool IsValid();
// ui::LayerDelegate:
void OnPaintLayer(const ui::PaintContext& context) override;
void OnDeviceScaleFactorChanged(float old_device_scale_factor,
float new_device_scale_factor) override {}
// ui::LayerObserver:
void LayerDestroyed(ui::Layer* layer) override;
// aura::WindowObserver:
void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
ui::PropertyChangeReason reason) override;
void OnWindowDestroying(aura::Window* window) override;
private:
void Update(const gfx::Size& size);
void Shutdown();
aura::Window* layer_window_;
ui::Layer* layer_;
std::unique_ptr<ui::Layer> mask_layer_;
int radius_;
DISALLOW_COPY_AND_ASSIGN(RoundedCornerDecorator);
};
} // namespace ash
#endif // ASH_PUBLIC_CPP_ROUNDED_CORNER_DECORATOR_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/public/cpp/rounded_corner_decorator.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/aura/test/aura_test_base.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
namespace ash {
typedef aura::test::AuraTestBase RoundedCornerDecoratorTest;
// Test that the decorator doesn't try to apply itself to destroyed layers.
TEST_F(RoundedCornerDecoratorTest, RoundedCornerMaskProperlyInvalidatesItself) {
std::unique_ptr<aura::Window> window(aura::test::CreateTestWindowWithBounds(
gfx::Rect(100, 100, 100, 100), root_window()));
auto decorator = std::make_unique<ash::RoundedCornerDecorator>(
window.get(), window.get(), window->layer(), 4);
// Confirm a mask layer exists and the decorator is valid.
EXPECT_TRUE(window->layer());
EXPECT_TRUE(window->layer()->layer_mask_layer());
EXPECT_TRUE(decorator->IsValid());
// Destroy window.
window.reset();
// Existing layer was destroyed, so the decorator should no longer be valid.
EXPECT_FALSE(decorator->IsValid());
}
// Test that mask layer changes bounds with the window it is applied to.
TEST_F(RoundedCornerDecoratorTest,
RoundedCornerMaskChangesBoundsOnWindowBoundsChange) {
std::unique_ptr<aura::Window> window(aura::test::CreateTestWindowWithBounds(
gfx::Rect(100, 100, 100, 100), root_window()));
auto decorator = std::make_unique<ash::RoundedCornerDecorator>(
window.get(), window.get(), window->layer(), 4);
// Make sure the mask layer has the correct bounds and exists.
ASSERT_TRUE(window->layer()->layer_mask_layer());
EXPECT_EQ(gfx::Rect(0, 0, 100, 100),
window->layer()->layer_mask_layer()->bounds());
// Change the bounds of the window. Set zero duration animations to apply
// changes immediately.
window->SetBounds(gfx::Rect(0, 0, 150, 150));
// Make sure the mask layer's bounds are also changed.
EXPECT_EQ(gfx::Rect(0, 0, 150, 150).ToString(), window->bounds().ToString());
EXPECT_EQ(window->layer()->layer_mask_layer()->bounds().ToString(),
window->bounds().ToString());
}
} // namespace ash
......@@ -41,7 +41,6 @@ void BaseState::OnWMEvent(WindowState* window_state, const WMEvent* event) {
if (event->IsBoundsEvent()) {
HandleBoundsEvents(window_state, event);
window_state->UpdatePipRoundedCorners();
return;
}
DCHECK(event->IsTransitionEvent());
......
......@@ -7,7 +7,6 @@
#include <memory>
#include <utility>
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/window_animation_types.h"
#include "ash/public/cpp/window_properties.h"
#include "ash/public/cpp/window_state_type.h"
......@@ -46,9 +45,6 @@ namespace ash {
namespace wm {
namespace {
// TODO(edcourtney): Move this to a PIP specific file, once it's created.
const int kPipRoundedCornerRadius = 8;
bool IsTabletModeEnabled() {
return Shell::Get()
->tablet_mode_controller()
......@@ -151,72 +147,6 @@ void MoveAllTransientChildrenToNewRoot(aura::Window* window) {
} // namespace
class WindowState::PipMask : public ui::LayerDelegate,
public aura::WindowObserver {
public:
explicit PipMask(aura::Window* window)
: layer_(ui::LAYER_TEXTURED), window_(window) {
DCHECK(window);
DCHECK(window->layer());
window_->AddObserver(this);
layer_.set_delegate(this);
layer_.SetFillsBoundsOpaquely(false);
layer_.SetBounds(window->layer()->bounds());
}
~PipMask() override {
if (window_)
window_->RemoveObserver(this);
layer_.set_delegate(nullptr);
}
ui::Layer* layer() { return &layer_; }
const aura::Window* window() const { return window_; }
private:
// ui::LayerDelegate overridden:
void OnPaintLayer(const ui::PaintContext& context) override {
cc::PaintFlags flags;
flags.setAlpha(255);
flags.setAntiAlias(true);
flags.setStyle(cc::PaintFlags::kFill_Style);
const int radius = kPipRoundedCornerRadius;
SkScalar radii[8] = {radius, radius, // top-left
radius, radius, // top-right
radius, radius, // bottom-right
radius, radius}; // bottom-left
SkPath path;
path.addRoundRect(gfx::RectToSkRect(gfx::Rect(layer()->size())), radii);
ui::PaintRecorder recorder(context, layer()->size());
recorder.canvas()->DrawPath(path, flags);
}
void OnDeviceScaleFactorChanged(float old_device_scale_factor,
float new_device_scale_factor) override {}
// aura::WindowObserver overridden:
void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
ui::PropertyChangeReason reason) override {
layer_.SetBounds(new_bounds);
}
void OnWindowDestroying(aura::Window* window) override {
window_->RemoveObserver(this);
window_ = nullptr;
}
ui::Layer layer_;
aura::Window* window_;
DISALLOW_COPY_AND_ASSIGN(PipMask);
};
constexpr base::TimeDelta WindowState::kBoundsChangeSlideDuration;
WindowState::~WindowState() {
......@@ -736,29 +666,6 @@ void WindowState::SetBoundsDirectCrossFade(const gfx::Rect& new_bounds,
CrossFadeAnimation(window_, std::move(old_layer_owner), animation_type);
}
void WindowState::UpdatePipRoundedCorners() {
if (!features::IsPipRoundedCornersEnabled())
return;
auto* layer = window()->layer();
if (!IsPip()) {
// Only remove the mask layer if it is from the existing PIP mask.
if (layer && pip_mask_ && layer->layer_mask_layer() == pip_mask_->layer())
layer->SetMaskLayer(nullptr);
pip_mask_.reset();
return;
}
gfx::Rect bounds = window()->bounds();
if (layer && (!pip_mask_ || pip_mask_->layer()->size() != bounds.size())) {
layer->SetMaskLayer(nullptr);
if (!pip_mask_ || window() != pip_mask_->window())
pip_mask_ = std::make_unique<PipMask>(window());
layer->SetFillsBoundsOpaquely(false);
layer->SetMaskLayer(pip_mask_->layer());
}
}
void WindowState::UpdatePipState(bool was_pip) {
if (IsPip()) {
::wm::SetWindowVisibilityAnimationType(
......@@ -868,14 +775,5 @@ void WindowState::OnWindowDestroying(aura::Window* window) {
delegate_.reset();
}
void WindowState::OnWindowLayerRecreated(aura::Window* window) {
DCHECK_EQ(window_, window);
// THe mask layer will be moved with old layer.
DCHECK(!window_->layer()->layer_mask_layer());
pip_mask_.reset();
if (IsPip())
UpdatePipRoundedCorners();
}
} // namespace wm
} // namespace ash
......@@ -364,9 +364,6 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
FRIEND_TEST_ALL_PREFIXES(WindowStateTest, PipWindowMaskRecreated);
FRIEND_TEST_ALL_PREFIXES(WindowStateTest, PipWindowHasMaskLayer);
// Class to host the rounded mask for PIP windows.
class PipMask;
explicit WindowState(aura::Window* window);
WindowStateDelegate* delegate() { return delegate_.get(); }
......@@ -417,10 +414,6 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
const gfx::Rect& bounds,
gfx::Tween::Type animation_type = gfx::Tween::EASE_OUT);
// Updates rounded corners for PIP window states. Removes rounded corners
// for non-PIP window states.
void UpdatePipRoundedCorners();
// Update PIP related state, such as next window animation type, upon
// state change.
void UpdatePipState(bool was_pip);
......@@ -436,7 +429,6 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
intptr_t old) override;
void OnWindowAddedToRootWindow(aura::Window* window) override;
void OnWindowDestroying(aura::Window* window) override;
void OnWindowLayerRecreated(aura::Window* window) override;
// The owner of this window settings.
aura::Window* window_;
......@@ -454,9 +446,6 @@ class ASH_EXPORT WindowState : public aura::WindowObserver {
bool cached_always_on_top_;
bool allow_set_bounds_direct_ = false;
// Mask layer for PIP windows.
std::unique_ptr<PipMask> pip_mask_;
// A property to save the ratio between snapped window width and display
// workarea width. It is used to update snapped window width on
// AdjustSnappedBounds() when handling workspace events.
......
......@@ -162,67 +162,6 @@ TEST_F(WindowStateTest, PipWindowCannotSnap) {
EXPECT_FALSE(window_state->CanSnap());
}
// Test that a mask layer is created correctly.
TEST_F(WindowStateTest, PipWindowMaskRecreated) {
// Prepare a PIP window.
std::unique_ptr<aura::Window> window(
CreateTestWindowInShellWithBounds(gfx::Rect(100, 100, 100, 100)));
WindowState* window_state = GetWindowState(window.get());
const WMEvent enter_pip(WM_EVENT_PIP);
window_state->OnWMEvent(&enter_pip);
window_state->UpdatePipRoundedCorners();
// Mask layer exists.
EXPECT_TRUE(window->layer());
EXPECT_TRUE(window->layer()->layer_mask_layer());
// Close the PIP window.
window->Hide();
// Reshow the PIP window.
window->Show();
// Confirms a mask layer exists.
EXPECT_TRUE(window->layer());
EXPECT_TRUE(window->layer()->layer_mask_layer());
}
// Test that a PIP window cannot be snapped.
TEST_F(WindowStateTest, PipWindowHasMaskLayer) {
// Prepare a PIP window.
std::unique_ptr<aura::Window> window(
CreateTestWindowInShellWithBounds(gfx::Rect(100, 100, 100, 100)));
WindowState* window_state = GetWindowState(window.get());
const WMEvent enter_pip(WM_EVENT_PIP);
window_state->OnWMEvent(&enter_pip);
EXPECT_TRUE(window->layer());
// No mask layer exist at this time.
EXPECT_FALSE(window->layer()->layer_mask_layer());
// Install a mask layer.
window_state->UpdatePipRoundedCorners();
// Mask layer exists at this time.
EXPECT_TRUE(window->layer()->layer_mask_layer());
// Make sure the layer has the same bounds.
EXPECT_EQ(gfx::Rect(100, 100, 100, 100).ToString(),
window->bounds().ToString());
EXPECT_EQ(window->layer()->layer_mask_layer()->bounds().ToString(),
window->bounds().ToString());
// Change the bounds of the window.
window->SetBounds(gfx::Rect(0, 0, 150, 150));
// Make sure the layer's bounds is also changed.
EXPECT_EQ(gfx::Rect(0, 0, 150, 150).ToString(), window->bounds().ToString());
EXPECT_EQ(window->layer()->layer_mask_layer()->bounds().ToString(),
window->bounds().ToString());
}
// Test that modal window dialogs can be snapped.
TEST_F(WindowStateTest, SnapModalWindowWithoutMaximumSizeLimit) {
UpdateDisplay("0+0-600x900");
......
......@@ -35,6 +35,7 @@
#include "ui/views/window/window_resize_utils.h"
#if defined(OS_CHROMEOS)
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/window_properties.h" // nogncheck
#include "ui/aura/window.h"
#endif
......@@ -199,6 +200,7 @@ OverlayWindowViews::OverlayWindowViews(
params.visible_on_all_workspaces = true;
params.remove_standard_frame = true;
params.name = "PictureInPictureWindow";
params.layer_type = ui::LAYER_NOT_DRAWN;
// Set WidgetDelegate for more control over |widget_|.
params.delegate = new OverlayWindowWidgetDelegate(this);
......@@ -279,6 +281,9 @@ gfx::Rect OverlayWindowViews::CalculateAndUpdateWindowBounds() {
}
void OverlayWindowViews::SetUpViews() {
GetRootView()->SetPaintToLayer(ui::LAYER_TEXTURED);
GetRootView()->layer()->set_name("RootView");
// views::View that is displayed when video is hidden. ----------------------
// Adding an extra pixel to width/height makes sure controls background cover
// entirely window when platform has fractional scale applied.
......@@ -286,11 +291,13 @@ void OverlayWindowViews::SetUpViews() {
larger_window_bounds.Inset(-1, -1);
window_background_view_->SetSize(larger_window_bounds.size());
window_background_view_->SetPaintToLayer(ui::LAYER_SOLID_COLOR);
window_background_view_->layer()->set_name("WindowBackgroundView");
GetWindowBackgroundLayer()->SetColor(SK_ColorBLACK);
// views::View that holds the scrim, which appears with the controls. -------
controls_scrim_view_->SetSize(GetBounds().size());
controls_scrim_view_->SetPaintToLayer(ui::LAYER_SOLID_COLOR);
controls_scrim_view_->layer()->set_name("ControlsScrimView");
GetControlsScrimLayer()->SetColor(gfx::kGoogleGrey900);
GetControlsScrimLayer()->SetOpacity(0.43f);
......@@ -298,15 +305,18 @@ void OverlayWindowViews::SetUpViews() {
controls_parent_view_->SetPaintToLayer(ui::LAYER_TEXTURED);
controls_parent_view_->SetSize(GetBounds().size());
controls_parent_view_->layer()->SetFillsBoundsOpaquely(false);
controls_parent_view_->layer()->set_name("ControlsParentView");
controls_parent_view_->set_owned_by_client();
// views::View that closes the window. --------------------------------------
close_controls_view_->SetPaintToLayer(ui::LAYER_TEXTURED);
close_controls_view_->layer()->SetFillsBoundsOpaquely(false);
close_controls_view_->layer()->set_name("CloseControlsView");
close_controls_view_->set_owned_by_client();
// view::View that holds the video. -----------------------------------------
video_view_->SetPaintToLayer(ui::LAYER_TEXTURED);
video_view_->layer()->set_name("VideoView");
// views::View that toggles play/pause. -------------------------------------
play_pause_controls_view_->SetImageAlignment(
......@@ -318,6 +328,7 @@ void OverlayWindowViews::SetUpViews() {
// views::View that shows the affordance that the window can be resized. ----
resize_handle_view_->SetPaintToLayer(ui::LAYER_TEXTURED);
resize_handle_view_->layer()->SetFillsBoundsOpaquely(false);
resize_handle_view_->layer()->set_name("ResizeHandleView");
resize_handle_view_->set_owned_by_client();
#endif
......@@ -551,6 +562,14 @@ void OverlayWindowViews::Close() {
void OverlayWindowViews::Show() {
views::Widget::Show();
#if defined(OS_CHROMEOS)
// For rounded corners.
if (ash::features::IsPipRoundedCornersEnabled()) {
decorator_ = std::make_unique<ash::RoundedCornerDecorator>(
GetNativeWindow(), GetNativeWindow(), GetRootView()->layer(),
ash::kPipRoundedCornerRadius);
}
#endif
// If this is not the first time the window is shown, this will be a no-op.
has_been_shown_ = true;
......@@ -569,7 +588,7 @@ bool OverlayWindowViews::IsAlwaysOnTop() const {
}
ui::Layer* OverlayWindowViews::GetLayer() {
return views::Widget::GetLayer();
return GetRootView()->layer();
}
gfx::Rect OverlayWindowViews::GetBounds() const {
......
......@@ -11,6 +11,10 @@
#include "ui/views/controls/button/button.h"
#include "ui/views/widget/widget.h"
#if defined(OS_CHROMEOS)
#include "ash/public/cpp/rounded_corner_decorator.h"
#endif
namespace views {
class ControlImageButton;
class CloseImageButton;
......@@ -193,6 +197,9 @@ class OverlayWindowViews : public content::OverlayWindow,
std::unique_ptr<views::ToggleImageButton> play_pause_controls_view_;
std::unique_ptr<views::ControlImageButton> first_custom_controls_view_;
std::unique_ptr<views::ControlImageButton> second_custom_controls_view_;
#if defined(OS_CHROMEOS)
std::unique_ptr<ash::RoundedCornerDecorator> decorator_;
#endif
// Automatically hides the controls a few seconds after user tap gesture.
base::RetainingOneShotTimer hide_controls_timer_;
......
......@@ -10,9 +10,11 @@
#include "ash/frame/header_view.h"
#include "ash/frame/non_client_frame_view_ash.h"
#include "ash/frame/wide_frame_view.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/public/cpp/caption_buttons/caption_button_model.h"
#include "ash/public/cpp/default_frame_header.h"
#include "ash/public/cpp/immersive/immersive_fullscreen_controller.h"
#include "ash/public/cpp/rounded_corner_decorator.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h"
#include "ash/public/cpp/window_state_type.h"
......@@ -915,10 +917,16 @@ bool ClientControlledShellSurface::OnPreWidgetCommit() {
// make sure to deactivate it now.
wm::DeactivateWindow(window);
}
widget_->widget_delegate()->set_can_activate(false);
if (ash::features::IsPipRoundedCornersEnabled()) {
decorator_ = std::make_unique<ash::RoundedCornerDecorator>(
window_state->window(), host_window(), host_window()->layer(),
ash::kPipRoundedCornerRadius);
}
} else {
widget_->widget_delegate()->set_can_activate(true);
decorator_.reset(); // Remove rounded corners.
}
if (client_controlled_state_->EnterNextState(window_state,
......
......@@ -20,6 +20,7 @@
namespace ash {
class NonClientFrameViewAsh;
class ImmersiveFullscreenController;
class RoundedCornerDecorator;
class WideFrameView;
namespace mojom {
......@@ -294,6 +295,8 @@ class ClientControlledShellSurface
std::unique_ptr<ash::WideFrameView> wide_frame_;
std::unique_ptr<ash::RoundedCornerDecorator> decorator_;
std::unique_ptr<ui::CompositorLock> orientation_compositor_lock_;
// The orientation to be applied when widget is being created. Only set when
......
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