Commit d1531b9a authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

CrOS Shelf: Start moving some hotseat logic into the hotseat widget

The general idea here is to encapsulate more of the hotseat's behavior
into its own class rather than have it all over the shelf layout
manager. Eventually, I hope to get rid of the huge
"CalculateHotseatState" method by setting the hotseat state to the
appropriate values from the relevant places.

Change-Id: I03bf50bc9f6fb68f7f22f1b6ec966f08f48220da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893997
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711796}
parent a72a5f6b
......@@ -186,6 +186,14 @@ void HotseatWidget::Initialize(aura::Window* container, Shelf* shelf) {
delegate_view_->Init(scrollable_shelf_view(), GetLayer());
}
void HotseatWidget::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}
void HotseatWidget::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
void HotseatWidget::OnMouseEvent(ui::MouseEvent* event) {
if (event->type() == ui::ET_MOUSE_PRESSED)
keyboard::KeyboardUIController::Get()->HideKeyboardImplicitlyByUser();
......@@ -231,6 +239,15 @@ const ShelfView* HotseatWidget::GetShelfView() const {
const_cast<HotseatWidget*>(this)->GetShelfView());
}
void HotseatWidget::SetState(HotseatState state) {
if (state_ == state)
return;
state_ = state;
for (auto& observer : observers_)
observer.OnHotseatStateChanged();
}
bool HotseatWidget::IsShowingOverflowBubble() const {
return GetShelfView()->IsShowingOverflowBubble();
}
......
......@@ -7,6 +7,9 @@
#include "ash/ash_export.h"
#include "ash/public/cpp/shelf_config.h"
#include "ash/public/cpp/shelf_types.h"
#include "base/observer_list.h"
#include "base/observer_list_types.h"
#include "ui/views/widget/widget.h"
namespace ash {
......@@ -19,12 +22,19 @@ class ShelfView;
class ASH_EXPORT HotseatWidget : public views::Widget,
public ShelfConfig::Observer {
public:
class Observer : public base::CheckedObserver {
public:
virtual void OnHotseatStateChanged() = 0;
};
HotseatWidget();
~HotseatWidget() override;
// Initializes the widget, sets its contents view and basic properties.
void Initialize(aura::Window* container, Shelf* shelf);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
// views::Widget:
void OnMouseEvent(ui::MouseEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
......@@ -58,6 +68,9 @@ class ASH_EXPORT HotseatWidget : public views::Widget,
ShelfView* GetShelfView();
const ShelfView* GetShelfView() const;
void SetState(HotseatState state);
HotseatState state() const { return state_; }
ScrollableShelfView* scrollable_shelf_view() {
return scrollable_shelf_view_;
}
......@@ -82,6 +95,10 @@ class ASH_EXPORT HotseatWidget : public views::Widget,
// of the hotseat.
DelegateView* delegate_view_ = nullptr;
HotseatState state_ = HotseatState::kShown;
base::ObserverList<Observer> observers_;
// Whether the widget is currently extended because the user has manually
// dragged it. This will be reset with any visible shelf configuration change.
bool is_manually_extended_ = false;
......
......@@ -28,7 +28,6 @@
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_layout_manager_observer.h"
#include "ash/shelf/shelf_navigation_widget.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/system/locale/locale_update_controller_impl.h"
#include "ash/system/status_area_widget.h"
......@@ -223,22 +222,24 @@ class HideAnimationObserver : public ui::ImplicitAnimationObserver {
};
// Forwards gesture events to ShelfLayoutManager to hide the hotseat
// when it is kExtended.
// when it is extended.
class HotseatEventHandler : public ui::EventHandler,
public ShelfLayoutManagerObserver {
public HotseatWidget::Observer {
public:
explicit HotseatEventHandler(ShelfLayoutManager* shelf_layout_manager)
: shelf_layout_manager_(shelf_layout_manager) {
shelf_layout_manager_->AddObserver(this);
HotseatEventHandler(ShelfLayoutManager* shelf_layout_manager,
HotseatWidget* widget)
: shelf_layout_manager_(shelf_layout_manager), widget_(widget) {
widget_->AddObserver(this);
Shell::Get()->AddPreTargetHandler(this);
}
~HotseatEventHandler() override {
shelf_layout_manager_->RemoveObserver(this);
widget_->RemoveObserver(this);
Shell::Get()->RemovePreTargetHandler(this);
}
// ShelfLayoutManagerObserver:
void OnHotseatStateChanged(HotseatState state) override {
// HotseatWidget::Observer:
void OnHotseatStateChanged() override {
const HotseatState state = widget_->state();
should_forward_event_ = state == HotseatState::kExtended;
}
......@@ -254,6 +255,7 @@ class HotseatEventHandler : public ui::EventHandler,
// Whether events should get forwarded to ShelfLayoutManager.
bool should_forward_event_ = false;
ShelfLayoutManager* const shelf_layout_manager_; // unowned.
HotseatWidget* const widget_; // unowned.
DISALLOW_COPY_AND_ASSIGN(HotseatEventHandler);
};
......@@ -294,7 +296,6 @@ ShelfLayoutManager::State::State()
: visibility_state(SHELF_VISIBLE),
auto_hide_state(SHELF_AUTO_HIDE_HIDDEN),
window_state(WorkspaceWindowState::kDefault),
hotseat_state(HotseatState::kShown),
pre_lock_screen_animation_active(false),
session_state(session_manager::SessionState::UNKNOWN) {}
......@@ -328,8 +329,7 @@ bool ShelfLayoutManager::State::Equals(const State& other) const {
other.window_state == window_state &&
other.pre_lock_screen_animation_active ==
pre_lock_screen_animation_active &&
other.session_state == session_state &&
other.hotseat_state == hotseat_state;
other.session_state == session_state;
}
// ShelfLayoutManager::ScopedSuspendVisibilityUpdate ---------------------------
......@@ -370,6 +370,8 @@ ShelfLayoutManager::~ShelfLayoutManager() {
observer.WillDeleteShelfLayoutManager();
display::Screen::GetScreen()->RemoveObserver(this);
auto* shell = Shell::Get();
if (shelf_widget_->hotseat_widget())
shelf_widget_->hotseat_widget()->RemoveObserver(this);
shell->locale_update_controller()->RemoveObserver(this);
shell->RemoveShellObserver(this);
shell->lock_state_controller()->RemoveObserver(this);
......@@ -388,6 +390,7 @@ void ShelfLayoutManager::InitObservers() {
shell->lock_state_controller()->AddObserver(this);
shell->activation_client()->AddObserver(this);
shell->locale_update_controller()->AddObserver(this);
shelf_widget_->hotseat_widget()->AddObserver(this);
state_.session_state = shell->session_controller()->GetSessionState();
shelf_background_type_ = GetShelfBackgroundType();
wallpaper_controller_observer_.Add(shell->wallpaper_controller());
......@@ -572,7 +575,7 @@ void ShelfLayoutManager::ProcessGestureEventOfInAppHotseat(
aura::Window* target) {
if (!IsHotseatEnabled())
return;
DCHECK_EQ(state_.hotseat_state, HotseatState::kExtended);
DCHECK_EQ(hotseat_state(), HotseatState::kExtended);
if (IsShelfWindow(target) || drag_status_ != DragStatus::kDragNone)
return;
......@@ -855,6 +858,15 @@ void ShelfLayoutManager::OnOverviewModeEnded() {
UpdateVisibilityState();
}
void ShelfLayoutManager::OnHotseatStateChanged() {
if (hotseat_state() == HotseatState::kExtended) {
hotseat_event_handler_ = std::make_unique<HotseatEventHandler>(
this, shelf_widget_->hotseat_widget());
} else {
hotseat_event_handler_.reset();
}
}
void ShelfLayoutManager::OnAppListVisibilityWillChange(bool shown,
int64_t display_id) {
// We respond to "will change" and "did change" notifications in the same
......@@ -961,29 +973,35 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
if (suspend_visibility_update_)
return;
const HotseatState hotseat_previous_state = hotseat_state();
State state;
state.visibility_state = visibility_state;
state.auto_hide_state = CalculateAutoHideState(visibility_state);
state.window_state =
GetShelfWorkspaceWindowState(shelf_widget_->GetNativeWindow());
state.hotseat_state =
CalculateHotseatState(state.visibility_state, state.auto_hide_state);
// Preserve the log in screen states.
state.session_state = state_.session_state;
state.pre_lock_screen_animation_active =
state_.pre_lock_screen_animation_active;
const HotseatState hotseat_new_state =
CalculateHotseatState(state.visibility_state, state.auto_hide_state);
// Force an update because drag events affect the shelf bounds and we
// should animate back to the normal bounds at the end of the drag event.
bool force_update = (drag_status_ == kDragCancelInProgress ||
drag_status_ == kDragCompleteInProgress);
if (!force_update && state_.Equals(state))
if (!force_update && state_.Equals(state) &&
hotseat_new_state == hotseat_previous_state) {
return; // Nothing changed.
}
for (auto& observer : observers_)
observer.WillChangeVisibilityState(visibility_state);
shelf_widget_->hotseat_widget()->SetState(hotseat_new_state);
StopAutoHideTimer();
State old_state = state_;
......@@ -1037,15 +1055,6 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
for (auto& observer : observers_)
observer.OnAutoHideStateChanged(state_.auto_hide_state);
}
if (old_state.hotseat_state != state_.hotseat_state) {
if (state_.hotseat_state == HotseatState::kExtended)
hotseat_event_handler_ = std::make_unique<HotseatEventHandler>(this);
else
hotseat_event_handler_.reset();
for (auto& observer : observers_)
observer.OnHotseatStateChanged(state_.hotseat_state);
}
}
HotseatState ShelfLayoutManager::CalculateHotseatState(
......@@ -1124,14 +1133,14 @@ HotseatState ShelfLayoutManager::CalculateHotseatState(
// If the drag being completed is not a Hotseat drag, don't change the
// state.
if (!hotseat_is_in_drag_)
return state_.hotseat_state;
return hotseat_state();
if (shelf_widget_->hotseat_widget()->IsExtended())
return HotseatState::kExtended;
// |drag_amount_| is relative to the top of the hotseat when the drag
// begins with an extended hotseat. Correct for this to get
// |total_amount_dragged|.
const int drag_base = (state_.hotseat_state == HotseatState::kExtended &&
const int drag_base = (hotseat_state() == HotseatState::kExtended &&
state_.visibility_state == SHELF_VISIBLE)
? (ShelfConfig::Get()->hotseat_size() +
ShelfConfig::Get()->hotseat_bottom_padding())
......@@ -1175,7 +1184,7 @@ HotseatState ShelfLayoutManager::CalculateHotseatState(
default:
// Do not change the hotseat state until the drag is complete or
// canceled.
return state_.hotseat_state;
return hotseat_state();
}
NOTREACHED();
return HotseatState::kShown;
......@@ -1466,7 +1475,7 @@ void ShelfLayoutManager::CalculateTargetBounds(
if (shelf_->IsHorizontalAlignment()) {
int hotseat_distance_from_bottom_of_display;
const int hotseat_size = ShelfConfig::Get()->hotseat_size();
switch (state_.hotseat_state) {
switch (hotseat_state()) {
case HotseatState::kShown: {
// When the hotseat state is HotseatState::kShown in tablet mode, the
// home launcher is showing. Elevate the hotseat a few px to match the
......@@ -1497,7 +1506,7 @@ void ShelfLayoutManager::CalculateTargetBounds(
home_button_edge_spacing - hotseat_width
: target_bounds->nav_bounds_in_shelf.right() +
home_button_edge_spacing;
if (state_.hotseat_state != HotseatState::kShown) {
if (hotseat_state() != HotseatState::kShown) {
// Give the hotseat more space if it is shown outside of the shelf.
hotseat_width = available_bounds.width();
hotseat_x = 0;
......@@ -1642,14 +1651,13 @@ void ShelfLayoutManager::UpdateTargetBoundsForGesture(
const int hotseat_extended_y =
Shell::Get()->shelf_config()->hotseat_size() +
Shell::Get()->shelf_config()->hotseat_bottom_padding();
const int hotseat_baseline =
(state_.hotseat_state == HotseatState::kExtended) ? -hotseat_extended_y
: shelf_size;
bool use_hotseat_baseline =
(state_.hotseat_state == HotseatState::kExtended &&
visibility_state() == SHELF_AUTO_HIDE) ||
(state_.hotseat_state == HotseatState::kHidden &&
visibility_state() != SHELF_AUTO_HIDE);
const int hotseat_baseline = (hotseat_state() == HotseatState::kExtended)
? -hotseat_extended_y
: shelf_size;
bool use_hotseat_baseline = (hotseat_state() == HotseatState::kExtended &&
visibility_state() == SHELF_AUTO_HIDE) ||
(hotseat_state() == HotseatState::kHidden &&
visibility_state() != SHELF_AUTO_HIDE);
hotseat_y = std::max(
-hotseat_extended_y,
static_cast<int>((use_hotseat_baseline ? hotseat_baseline : 0) +
......@@ -1914,7 +1922,7 @@ bool ShelfLayoutManager::ShouldHomeGestureHandleEvent(float scroll_y) const {
return false;
const bool up_on_shown_hotseat =
state_.hotseat_state == HotseatState::kShown && scroll_y < 0;
hotseat_state() == HotseatState::kShown && scroll_y < 0;
if (IsHotseatEnabled() && up_on_shown_hotseat) {
return GetHomeLauncherGestureHandlerModeForDrag() ==
HomeLauncherGestureHandler::Mode::kSwipeHomeToOverview;
......@@ -1922,14 +1930,14 @@ bool ShelfLayoutManager::ShouldHomeGestureHandleEvent(float scroll_y) const {
if (IsHotseatEnabled()) {
if (features::IsDragFromShelfToHomeOrOverviewEnabled() &&
state_.hotseat_state != HotseatState::kShown) {
hotseat_state() != HotseatState::kShown) {
// If hotseat is hidden or extended (in-app or in-overview), do not let
// HomeLauncherGestureHandler to handle the events.
return false;
}
const bool up_on_extended_hotseat =
state_.hotseat_state == HotseatState::kExtended && scroll_y < 0;
hotseat_state() == HotseatState::kExtended && scroll_y < 0;
if (!up_on_extended_hotseat)
return false;
}
......@@ -2151,8 +2159,8 @@ bool ShelfLayoutManager::StartShelfDrag(
// For the hotseat, |drag_amount_| is relative to the top of the shelf.
// To keep the hotseat from jumping to the top of the shelf on drag, set the
// offset to the hotseats extended position.
if (state_.hotseat_state == HotseatState::kExtended &&
// offset to the hotseat's extended position.
if (hotseat_state() == HotseatState::kExtended &&
visibility_state() == SHELF_VISIBLE) {
drag_amount_ = -(ShelfConfig::Get()->hotseat_size() +
ShelfConfig::Get()->hotseat_bottom_padding());
......@@ -2167,7 +2175,7 @@ void ShelfLayoutManager::MaybeSetupHotseatDrag(
if (!IsHotseatEnabled())
return;
// Do not allow Hotseat dragging when the hotseat is shown within the shelf.
if (state_.hotseat_state == HotseatState::kShown)
if (hotseat_state() == HotseatState::kShown)
return;
hotseat_is_in_drag_ = true;
......
......@@ -14,6 +14,7 @@
#include "ash/public/cpp/wallpaper_controller_observer.h"
#include "ash/session/session_observer.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell_observer.h"
#include "ash/system/locale/locale_update_controller_impl.h"
#include "ash/wm/desks/desks_controller.h"
......@@ -64,6 +65,7 @@ class ASH_EXPORT ShelfLayoutManager : public AppListControllerObserver,
public ShellObserver,
public SplitViewObserver,
public OverviewObserver,
public HotseatWidget::Observer,
public ::wm::ActivationChangeObserver,
public LockStateObserver,
public WmDefaultLayoutManager,
......@@ -119,7 +121,7 @@ class ASH_EXPORT ShelfLayoutManager : public AppListControllerObserver,
void ProcessGestureEventOfAutoHideShelf(ui::GestureEvent* event,
aura::Window* target);
// Handles events that are detected while the hotseat is kExtended in in-app
// Handles events that are detected while the hotseat is extended in in-app
// shelf.
void ProcessGestureEventOfInAppHotseat(ui::GestureEvent* event,
aura::Window* target);
......@@ -187,6 +189,9 @@ class ASH_EXPORT ShelfLayoutManager : public AppListControllerObserver,
void OnOverviewModeEndingAnimationComplete(bool canceled) override;
void OnOverviewModeEnded() override;
// HotseatWidget::Observer:
void OnHotseatStateChanged() override;
// AppListControllerObserver:
void OnAppListVisibilityWillChange(bool shown, int64_t display_id) override;
void OnAppListVisibilityChanged(bool shown, int64_t display_id) override;
......@@ -232,7 +237,9 @@ class ASH_EXPORT ShelfLayoutManager : public AppListControllerObserver,
bool updating_bounds() const { return updating_bounds_; }
ShelfAutoHideState auto_hide_state() const { return state_.auto_hide_state; }
HotseatState hotseat_state() const { return state_.hotseat_state; }
HotseatState hotseat_state() const {
return shelf_widget_->hotseat_widget()->state();
}
DragWindowFromShelfController* window_drag_controller_for_testing() {
return window_drag_controller_.get();
......
......@@ -30,9 +30,6 @@ class ASH_EXPORT ShelfLayoutManagerObserver {
virtual void OnBackgroundUpdated(ShelfBackgroundType background_type,
AnimationChangeType change_type) {}
// Called when the hotseat state changes.
virtual void OnHotseatStateChanged(HotseatState state) {}
// Called when ShelfLayoutManager has updated Shelf insets in work area
// insets.
virtual void OnWorkAreaInsetsChanged() {}
......
......@@ -3219,19 +3219,16 @@ class HotseatShelfLayoutManagerTest
};
// Records HotseatState transitions.
class HotseatStateWatcher : public ShelfLayoutManagerObserver {
class HotseatStateWatcher : public HotseatWidget::Observer {
public:
HotseatStateWatcher(ShelfLayoutManager* shelf_layout_manager)
: shelf_layout_manager_(shelf_layout_manager) {
shelf_layout_manager_->AddObserver(this);
}
~HotseatStateWatcher() override {
shelf_layout_manager_->RemoveObserver(this);
explicit HotseatStateWatcher(HotseatWidget* widget) : widget_(widget) {
widget_->AddObserver(this);
}
~HotseatStateWatcher() override { widget_->RemoveObserver(this); }
void OnHotseatStateChanged(HotseatState state) override {
void OnHotseatStateChanged() override {
run_loop_.QuitWhenIdle();
state_changes_.push_back(state);
state_changes_.push_back(widget_->state());
}
void CheckEqual(std::vector<HotseatState> state_changes) {
......@@ -3241,7 +3238,7 @@ class HotseatStateWatcher : public ShelfLayoutManagerObserver {
void WaitUntilStateChanged() { run_loop_.Run(); }
private:
ShelfLayoutManager* shelf_layout_manager_;
HotseatWidget* const widget_;
std::vector<HotseatState> state_changes_;
base::RunLoop run_loop_;
DISALLOW_COPY_AND_ASSIGN(HotseatStateWatcher);
......@@ -3539,8 +3536,8 @@ TEST_F(HotseatShelfLayoutManagerTest, ReleasingSlowDragBelowThreshold) {
EXPECT_EQ(HotseatState::kHidden, GetShelfLayoutManager()->hotseat_state());
}
// Tests that releasing the hotseat gesture above the threshold results in a
// kExtended hotseat.
// Tests that releasing the hotseat gesture above the threshold results in an
// extended hotseat.
TEST_P(HotseatShelfLayoutManagerTest, ReleasingSlowDragAboveThreshold) {
GetPrimaryShelf()->SetAutoHideBehavior(GetParam());
TabletModeControllerTestApi().EnterTabletMode();
......@@ -3577,7 +3574,8 @@ TEST_P(HotseatShelfLayoutManagerTest, ShowingOverviewFromShownAnimatesOnce) {
wm::ActivateWindow(window.get());
std::unique_ptr<HotseatStateWatcher> state_watcher_ =
std::make_unique<HotseatStateWatcher>(GetShelfLayoutManager());
std::make_unique<HotseatStateWatcher>(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
SwipeUpOnShelf();
ASSERT_EQ(HotseatState::kExtended, GetShelfLayoutManager()->hotseat_state());
......@@ -3781,7 +3779,8 @@ TEST_P(HotseatShelfLayoutManagerTest, HomeToOverviewChangesStateOnce) {
.CenterPoint();
{
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
OverviewAnimationWaiter waiter;
GetEventGenerator()->GestureTapAt(overview_button_center);
waiter.Wait();
......@@ -3800,7 +3799,8 @@ TEST_P(HotseatShelfLayoutManagerTest, HomeToOverviewChangesStateOnce) {
GetAppListTestHelper()->CheckVisibility(true);
// Activate overview and expect the hotseat only changes state to extended.
{
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
OverviewAnimationWaiter waiter;
GetEventGenerator()->GestureTapAt(overview_button_center);
waiter.Wait();
......@@ -3815,7 +3815,8 @@ TEST_P(HotseatShelfLayoutManagerTest, HomeToInAppChangesStateOnce) {
TabletModeControllerTestApi().EnterTabletMode();
// Go to in-app, the hotseat should hide.
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
std::unique_ptr<aura::Window> window =
AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400));
wm::ActivateWindow(window.get());
......@@ -3839,7 +3840,8 @@ TEST_P(HotseatShelfLayoutManagerTest, InAppToHomeChangesStateOnce) {
// Press the HomeLauncher button, the hotseat should transition directly to
// kShown.
{
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
views::View* home_button =
GetPrimaryShelf()->shelf_widget()->GetHomeButton();
GetEventGenerator()->GestureTapAt(
......@@ -3857,7 +3859,8 @@ TEST_P(HotseatShelfLayoutManagerTest, InAppToHomeChangesStateOnce) {
{
ui::ScopedAnimationDurationScaleMode regular_animations(
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
FlingUpOnShelf();
watcher.WaitUntilStateChanged();
watcher.CheckEqual({HotseatState::kShown});
......@@ -3874,7 +3877,8 @@ TEST_P(HotseatShelfLayoutManagerTest, InAppToHomeChangesStateOnce) {
// Press the HomeLauncher button, the hotseat should transition directly to
// kShown.
{
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
views::View* home_button =
GetPrimaryShelf()->shelf_widget()->GetHomeButton();
GetEventGenerator()->GestureTapAt(
......@@ -3897,7 +3901,8 @@ TEST_F(HotseatShelfLayoutManagerTest,
AshTestBase::CreateTestWindow(gfx::Rect(0, 0, 400, 400));
wm::ActivateWindow(window.get());
{
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
// Enter overview by using the controller.
OverviewAnimationWaiter waiter;
Shell::Get()->overview_controller()->StartOverview();
......@@ -3917,7 +3922,8 @@ TEST_F(HotseatShelfLayoutManagerTest,
GetShelfLayoutManager()->auto_hide_state());
SwipeUpOnShelf();
{
HotseatStateWatcher watcher(GetShelfLayoutManager());
HotseatStateWatcher watcher(
GetPrimaryShelf()->shelf_widget()->hotseat_widget());
// Enter overview by using the controller.
OverviewAnimationWaiter waiter;
Shell::Get()->overview_controller()->StartOverview();
......
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