Chromium Code Reviews| Index: ash/shelf/shelf_layout_manager.cc |
| diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
| index 229e4c24e3690c381f0e5473b2278947c21f21ad..fb07dabbb8f77f272bc1e535c9c8ca252674d8a5 100644 |
| --- a/ash/shelf/shelf_layout_manager.cc |
| +++ b/ash/shelf/shelf_layout_manager.cc |
| @@ -28,6 +28,7 @@ |
| #include "base/auto_reset.h" |
| #include "base/command_line.h" |
| #include "base/i18n/rtl.h" |
| +#include "ui/app_list/app_list_features.h" |
| #include "ui/base/ui_base_switches.h" |
| #include "ui/compositor/layer.h" |
| #include "ui/compositor/layer_animation_observer.h" |
| @@ -173,6 +174,10 @@ ShelfLayoutManager::~ShelfLayoutManager() { |
| ShellPort::Get()->RemoveLockStateObserver(this); |
| } |
| +void ShelfLayoutManager::OnAppListIsActive() { |
| + MaybeUpdateShelfBackground(AnimationChangeType::IMMEDIATE); |
| +} |
| + |
| void ShelfLayoutManager::PrepareForShutdown() { |
| in_shutdown_ = true; |
| // Stop observing changes to avoid updating a partially destructed shelf. |
| @@ -425,6 +430,15 @@ void ShelfLayoutManager::OnVirtualKeyboardStateChanged( |
| &keyboard_observer_); |
| } |
| +void ShelfLayoutManager::OnAppListVisibilityChanged(bool shown, |
| + aura::Window* root_window) { |
| + if (shelf_widget() == Shelf::ForWindow(root_window)->shelf_widget()) { |
|
xiyuan
2017/06/06 16:50:18
nit: reverse and bail out early
if (shelf_widget(
newcomer
2017/06/06 17:12:56
Done.
msw
2017/06/06 17:56:31
nit: if (shelf_ == Shelf::ForWindow(root_window))
newcomer
2017/06/06 23:26:27
Done.
|
| + app_list_is_being_shown = shown; |
| + if (app_list::features::IsFullscreenAppListEnabled()) |
| + MaybeUpdateShelfBackground(AnimationChangeType::IMMEDIATE); |
| + } |
| +} |
| + |
| void ShelfLayoutManager::OnWindowActivated(ActivationReason reason, |
| aura::Window* gained_active, |
| aura::Window* lost_active) { |
| @@ -468,6 +482,11 @@ ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const { |
| if (state_.session_state != session_manager::SessionState::ACTIVE) |
| return SHELF_BACKGROUND_OVERLAP; |
| + // If the app list is active, hide the shelf background to prevent overlap. |
| + if (app_list_is_being_shown && |
| + app_list::features::IsFullscreenAppListEnabled()) |
| + return SHELF_BACKGROUND_DEFAULT; |
| + |
| if (state_.visibility_state != SHELF_AUTO_HIDE && |
| state_.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED) { |
| return SHELF_BACKGROUND_MAXIMIZED; |