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

CrOS Shelf: Overview is actually considered 'in-app'

Bug: 1009550
Change-Id: Ifb3ba316dfd1c6bbb48a9e3c3d2a7efec6d5a630
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864609Reviewed-by: default avatarMatthew Mourgos <mmourgos@chromium.org>
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706532}
parent 9ec375f2
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "ash/ash_export.h" #include "ash/ash_export.h"
#include "ash/public/cpp/app_list/app_list_controller_observer.h" #include "ash/public/cpp/app_list/app_list_controller_observer.h"
#include "ash/public/cpp/tablet_mode_observer.h" #include "ash/public/cpp/tablet_mode_observer.h"
#include "ash/wm/overview/overview_observer.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/observer_list_types.h" #include "base/observer_list_types.h"
...@@ -21,7 +20,6 @@ namespace ash { ...@@ -21,7 +20,6 @@ namespace ash {
// values could change at runtime. // values could change at runtime.
class ASH_EXPORT ShelfConfig : public TabletModeObserver, class ASH_EXPORT ShelfConfig : public TabletModeObserver,
public AppListControllerObserver, public AppListControllerObserver,
public OverviewObserver,
public display::DisplayObserver { public display::DisplayObserver {
public: public:
class Observer : public base::CheckedObserver { class Observer : public base::CheckedObserver {
...@@ -55,10 +53,6 @@ class ASH_EXPORT ShelfConfig : public TabletModeObserver, ...@@ -55,10 +53,6 @@ class ASH_EXPORT ShelfConfig : public TabletModeObserver,
// AppListControllerObserver: // AppListControllerObserver:
void OnAppListVisibilityWillChange(bool shown, int64_t display_id) override; void OnAppListVisibilityWillChange(bool shown, int64_t display_id) override;
// OverviewObserver:
void OnOverviewModeStartingAnimationComplete(bool canceled) override;
void OnOverviewModeEndingAnimationComplete(bool canceled) override;
// Size of the shelf when visible (height when the shelf is horizontal and // Size of the shelf when visible (height when the shelf is horizontal and
// width when the shelf is vertical). // width when the shelf is vertical).
int shelf_size() const; int shelf_size() const;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/style/ash_color_provider.h" #include "ash/style/ash_color_provider.h"
#include "ash/wallpaper/wallpaper_controller_impl.h" #include "ash/wallpaper/wallpaper_controller_impl.h"
#include "ash/wm/overview/overview_controller.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
#include "ui/gfx/color_analysis.h" #include "ui/gfx/color_analysis.h"
...@@ -84,7 +83,6 @@ void ShelfConfig::Init() { ...@@ -84,7 +83,6 @@ void ShelfConfig::Init() {
Shell* shell = Shell::Get(); Shell* shell = Shell::Get();
shell->tablet_mode_controller()->AddObserver(this); shell->tablet_mode_controller()->AddObserver(this);
shell->app_list_controller()->AddObserver(this); shell->app_list_controller()->AddObserver(this);
shell->overview_controller()->AddObserver(this);
display::Screen::GetScreen()->AddObserver(this); display::Screen::GetScreen()->AddObserver(this);
} }
...@@ -94,7 +92,6 @@ void ShelfConfig::Shutdown() { ...@@ -94,7 +92,6 @@ void ShelfConfig::Shutdown() {
Shell* shell = Shell::Get(); Shell* shell = Shell::Get();
display::Screen::GetScreen()->RemoveObserver(this); display::Screen::GetScreen()->RemoveObserver(this);
shell->overview_controller()->RemoveObserver(this);
shell->app_list_controller()->RemoveObserver(this); shell->app_list_controller()->RemoveObserver(this);
shell->tablet_mode_controller()->RemoveObserver(this); shell->tablet_mode_controller()->RemoveObserver(this);
} }
...@@ -122,14 +119,6 @@ void ShelfConfig::OnAppListVisibilityWillChange(bool shown, ...@@ -122,14 +119,6 @@ void ShelfConfig::OnAppListVisibilityWillChange(bool shown,
OnShelfConfigUpdated(); OnShelfConfigUpdated();
} }
void ShelfConfig::OnOverviewModeStartingAnimationComplete(bool canceled) {
OnShelfConfigUpdated();
}
void ShelfConfig::OnOverviewModeEndingAnimationComplete(bool canceled) {
OnShelfConfigUpdated();
}
int ShelfConfig::shelf_size() const { int ShelfConfig::shelf_size() const {
// Before the hotseat redesign, the shelf always has the same size. // Before the hotseat redesign, the shelf always has the same size.
if (!chromeos::switches::ShouldShowShelfHotseat()) if (!chromeos::switches::ShouldShowShelfHotseat())
...@@ -204,13 +193,10 @@ int ShelfConfig::status_area_hit_region_padding() const { ...@@ -204,13 +193,10 @@ int ShelfConfig::status_area_hit_region_padding() const {
bool ShelfConfig::is_in_app() const { bool ShelfConfig::is_in_app() const {
Shell* shell = Shell::Get(); Shell* shell = Shell::Get();
const auto* overview = shell->overview_controller();
const auto* session = shell->session_controller(); const auto* session = shell->session_controller();
if (!overview || !session) if (!session)
return false; return false;
return !overview->InOverviewSession() && return session->GetSessionState() == session_manager::SessionState::ACTIVE &&
!overview->IsCompletingShutdownAnimations() &&
session->GetSessionState() == session_manager::SessionState::ACTIVE &&
!is_app_list_visible_; !is_app_list_visible_;
} }
......
...@@ -169,7 +169,7 @@ TEST_F(ShelfConfigTest, InAppMode) { ...@@ -169,7 +169,7 @@ TEST_F(ShelfConfigTest, InAppMode) {
// Now go into overview. // Now go into overview.
OverviewController* overview_controller = Shell::Get()->overview_controller(); OverviewController* overview_controller = Shell::Get()->overview_controller();
overview_controller->StartOverview(); overview_controller->StartOverview();
EXPECT_FALSE(ShelfConfig::Get()->is_in_app()); EXPECT_TRUE(ShelfConfig::Get()->is_in_app());
// Back to the app. // Back to the app.
overview_controller->EndOverview(); overview_controller->EndOverview();
......
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