Skip to content

Commit

Permalink
Remove activatable parameter
Browse files Browse the repository at this point in the history
This is always true, so let's remove it.

Bug: None
Change-Id: I26e08f096b56eb007989834a26b74a6c3a557d45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2680030
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Auto-Submit: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Malay Keshav <malaykeshav@chromium.org>
Cr-Commit-Position: refs/heads/master@{#852846}
  • Loading branch information
mitoshima authored and Chromium LUCI CQ committed Feb 10, 2021
1 parent 887d1bd commit 6c9371a
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 28 deletions.
2 changes: 1 addition & 1 deletion components/exo/client_controlled_shell_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ ClientControlledShellSurface::ClientControlledShellSurface(
bool can_minimize,
int container,
bool default_scale_cancellation)
: ShellSurfaceBase(surface, gfx::Point(), true, can_minimize, container),
: ShellSurfaceBase(surface, gfx::Point(), can_minimize, container),
current_pin_(chromeos::WindowPinType::kNone),
use_default_scale_cancellation_(default_scale_cancellation) {
server_side_resize_ = true;
Expand Down
4 changes: 2 additions & 2 deletions components/exo/display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ std::unique_ptr<ShellSurface> Display::CreateShellSurface(Surface* surface) {
}

return std::make_unique<ShellSurface>(
surface, gfx::Point(), true /* activatable */, false /* can_minimize */,
surface, gfx::Point(), /*can_minimize=*/false,
ash::desks_util::GetActiveDeskContainerId());
}

Expand All @@ -162,7 +162,7 @@ std::unique_ptr<XdgShellSurface> Display::CreateXdgShellSurface(
}

return std::make_unique<XdgShellSurface>(
surface, gfx::Point(), true /* activatable */, false /* can_minimize */,
surface, gfx::Point(), /*can_minimize=*/false,
ash::desks_util::GetActiveDeskContainerId());
}

Expand Down
18 changes: 9 additions & 9 deletions components/exo/pointer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,9 @@ TEST_F(PointerTest, OnPointerMotion) {
gfx::Vector2d(1, 1));

std::unique_ptr<Surface> child_surface(new Surface);
std::unique_ptr<ShellSurface> child_shell_surface(
new ShellSurface(child_surface.get(), gfx::Point(9, 9), true, false,
ash::desks_util::GetActiveDeskContainerId()));
std::unique_ptr<ShellSurface> child_shell_surface(new ShellSurface(
child_surface.get(), gfx::Point(9, 9), /*can_minimize=*/false,
ash::desks_util::GetActiveDeskContainerId()));
child_shell_surface->DisableMovement();
child_shell_surface->SetParent(shell_surface.get());
gfx::Size child_buffer_size(15, 15);
Expand Down Expand Up @@ -709,7 +709,7 @@ TEST_F(PointerTest, RegisterPointerEventsOnModal) {
// Create modal surface.
std::unique_ptr<Surface> surface(new Surface);
std::unique_ptr<ShellSurface> shell_surface(
new ShellSurface(surface.get(), gfx::Point(), true, false,
new ShellSurface(surface.get(), gfx::Point(), /*can_minimize=*/false,
ash::kShellWindowId_SystemModalContainer));
shell_surface->DisableMovement();
std::unique_ptr<Buffer> buffer(
Expand Down Expand Up @@ -768,7 +768,7 @@ TEST_F(PointerTest, IgnorePointerEventsOnNonModalWhenModalIsOpen) {
// Create surface for modal window.
std::unique_ptr<Surface> surface2(new Surface);
std::unique_ptr<ShellSurface> shell_surface2(
new ShellSurface(surface2.get(), gfx::Point(), true, false,
new ShellSurface(surface2.get(), gfx::Point(), /*can_minimize=*/false,
ash::kShellWindowId_SystemModalContainer));
shell_surface2->DisableMovement();
std::unique_ptr<Buffer> buffer2(
Expand Down Expand Up @@ -830,7 +830,7 @@ TEST_F(PointerTest, IgnorePointerLeaveOnModal) {
// Create modal surface.
std::unique_ptr<Surface> surface(new Surface);
std::unique_ptr<ShellSurface> shell_surface(
new ShellSurface(surface.get(), gfx::Point(), true, false,
new ShellSurface(surface.get(), gfx::Point(), /*can_minimize=*/false,
ash::kShellWindowId_SystemModalContainer));
shell_surface->DisableMovement();
std::unique_ptr<Buffer> buffer(
Expand Down Expand Up @@ -881,7 +881,7 @@ TEST_F(PointerTest, RegisterPointerEventsOnNonModal) {
// Create another surface for a non-modal window.
std::unique_ptr<Surface> surface2(new Surface);
std::unique_ptr<ShellSurface> shell_surface2(
new ShellSurface(surface2.get(), gfx::Point(), true, false,
new ShellSurface(surface2.get(), gfx::Point(), /*can_minimize=*/false,
ash::kShellWindowId_SystemModalContainer));
shell_surface2->DisableMovement();
std::unique_ptr<Buffer> buffer2(
Expand Down Expand Up @@ -1043,7 +1043,7 @@ TEST_F(PointerTest, OnPointerRelativeMotion) {
gfx::Vector2d(10, 10);
auto child_surface = std::make_unique<Surface>();
auto child_shell_surface = std::make_unique<ShellSurface>(
child_surface.get(), child_surface_origin, true, false,
child_surface.get(), child_surface_origin, /*can_minimize=*/false,
ash::desks_util::GetActiveDeskContainerId());
child_shell_surface->DisableMovement();
child_shell_surface->SetParent(shell_surface.get());
Expand Down Expand Up @@ -1171,7 +1171,7 @@ TEST_F(PointerTest, ConstrainPointer) {

auto child_surface = std::make_unique<Surface>();
auto child_shell_surface = std::make_unique<ShellSurface>(
child_surface.get(), gfx::Point(), true, false,
child_surface.get(), gfx::Point(), /*can_minimize=*/false,
ash::desks_util::GetActiveDeskContainerId());
child_shell_surface->DisableMovement();
child_shell_surface->SetParent(shell_surface.get());
Expand Down
6 changes: 2 additions & 4 deletions components/exo/shell_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,14 @@ ShellSurface::ScopedConfigure::~ScopedConfigure() {

ShellSurface::ShellSurface(Surface* surface,
const gfx::Point& origin,
bool activatable,
bool can_minimize,
int container)
: ShellSurfaceBase(surface, origin, activatable, can_minimize, container) {}
: ShellSurfaceBase(surface, origin, can_minimize, container) {}

ShellSurface::ShellSurface(Surface* surface)
: ShellSurfaceBase(surface,
gfx::Point(),
true,
true,
/*can_minimize=*/true,
ash::desks_util::GetActiveDeskContainerId()) {}

ShellSurface::~ShellSurface() {
Expand Down
1 change: 0 additions & 1 deletion components/exo/shell_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class ShellSurface : public ShellSurfaceBase, public ash::WindowStateObserver {
// specified as part of the geometry is relative to the shell surface.
ShellSurface(Surface* surface,
const gfx::Point& origin,
bool activatable,
bool can_minimize,
int container);
explicit ShellSurface(Surface* surface);
Expand Down
2 changes: 0 additions & 2 deletions components/exo/shell_surface_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,11 @@ int shell_id = 0;

ShellSurfaceBase::ShellSurfaceBase(Surface* surface,
const gfx::Point& origin,
bool activatable,
bool can_minimize,
int container)
: SurfaceTreeHost(base::StringPrintf("ExoShellSurfaceHost-%d", shell_id)),
origin_(origin),
container_(container),
activatable_(activatable),
can_minimize_(can_minimize) {
WMHelper::GetInstance()->AddActivationObserver(this);
surface->AddSurfaceObserver(this);
Expand Down
1 change: 0 additions & 1 deletion components/exo/shell_surface_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class ShellSurfaceBase : public SurfaceTreeHost,
// specified as part of the geometry is relative to the shell surface.
ShellSurfaceBase(Surface* surface,
const gfx::Point& origin,
bool activatable,
bool can_minimize,
int container);
~ShellSurfaceBase() override;
Expand Down
5 changes: 3 additions & 2 deletions components/exo/test/exo_test_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ ExoTestWindow::ExoTestWindow(std::unique_ptr<gfx::GpuMemoryBuffer> gpu_buffer,
surface_.reset(new Surface());
int container = is_modal ? ash::kShellWindowId_SystemModalContainer
: ash::desks_util::GetActiveDeskContainerId();
shell_surface_ = std::make_unique<ShellSurface>(surface_.get(), gfx::Point(),
true, false, container);
shell_surface_ =
std::make_unique<ShellSurface>(surface_.get(), gfx::Point(),
/*can minimize=*/false, container);

buffer_.reset(new Buffer(std::move(gpu_buffer)));
surface_->Attach(buffer_.get());
Expand Down
2 changes: 1 addition & 1 deletion components/exo/touch_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ TEST_F(TouchTest, TouchMultipleSurfaces) {

auto child_surface = std::make_unique<Surface>();
auto child_shell_surface = std::make_unique<ShellSurface>(
child_surface.get(), gfx::Point(), true, false,
child_surface.get(), gfx::Point(), /*can_minimize=*/false,
ash::desks_util::GetActiveDeskContainerId());
child_shell_surface->DisableMovement();
child_shell_surface->SetParent(shell_surface.get());
Expand Down
1 change: 0 additions & 1 deletion components/exo/ui_lock_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class UILockControllerTest : public test::ExoTestBase {
auto surface = std::make_unique<Surface>();
auto shell_surface = std::make_unique<ShellSurface>(
surface.get(), gfx::Point{0, 0},
/*activatable=*/true,
/*can_minimize=*/true, ash::desks_util::GetActiveDeskContainerId());
auto buffer = std::make_unique<Buffer>(
exo_test_helper()->CreateGpuMemoryBuffer({w, h}));
Expand Down
3 changes: 1 addition & 2 deletions components/exo/xdg_shell_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ namespace exo {

XdgShellSurface::XdgShellSurface(Surface* surface,
const gfx::Point& origin,
bool activatable,
bool can_minimize,
int container)
: ShellSurface(surface, origin, activatable, can_minimize, container) {}
: ShellSurface(surface, origin, can_minimize, container) {}

XdgShellSurface::~XdgShellSurface() {}

Expand Down
2 changes: 1 addition & 1 deletion components/exo/xdg_shell_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class XdgShellSurface : public ShellSurface {
// specified as part of the geometry is relative to the shell surface.
XdgShellSurface(Surface* surface,
const gfx::Point& origin,
bool activatable,
bool can_minimize,
int container);
~XdgShellSurface() override;

// ShellSurfaceBase::
void OverrideInitParams(views::Widget::InitParams* params) override;

bool x_flipped() const { return x_flipped_; }
Expand Down
1 change: 0 additions & 1 deletion components/exo/xdg_shell_surface_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class XdgShellSurfaceTest : public test::ExoTestBase {
auto surface = std::make_unique<Surface>();
auto shell_surface = std::make_unique<XdgShellSurface>(
surface.get(), gfx::Point{0, 0},
/*activatable=*/true,
/*can_minimize=*/true, ash::desks_util::GetActiveDeskContainerId());
auto buffer = std::make_unique<Buffer>(
exo_test_helper()->CreateGpuMemoryBuffer({w, h}));
Expand Down

0 comments on commit 6c9371a

Please sign in to comment.