Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: ash/shelf/shelf_layout_manager.cc

Issue 2898743002: Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: Rebased to resolve merge conflicts, Refactored to use observers, addressed comments, and disabled a… Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/shelf/shelf_layout_manager.h" 5 #include "ash/shelf/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "ash/shell.h" 21 #include "ash/shell.h"
22 #include "ash/shell_port.h" 22 #include "ash/shell_port.h"
23 #include "ash/system/status_area_widget.h" 23 #include "ash/system/status_area_widget.h"
24 #include "ash/wm/fullscreen_window_finder.h" 24 #include "ash/wm/fullscreen_window_finder.h"
25 #include "ash/wm/mru_window_tracker.h" 25 #include "ash/wm/mru_window_tracker.h"
26 #include "ash/wm/screen_pinning_controller.h" 26 #include "ash/wm/screen_pinning_controller.h"
27 #include "ash/wm/window_state.h" 27 #include "ash/wm/window_state.h"
28 #include "base/auto_reset.h" 28 #include "base/auto_reset.h"
29 #include "base/command_line.h" 29 #include "base/command_line.h"
30 #include "base/i18n/rtl.h" 30 #include "base/i18n/rtl.h"
31 #include "ui/app_list/app_list_features.h"
31 #include "ui/base/ui_base_switches.h" 32 #include "ui/base/ui_base_switches.h"
32 #include "ui/compositor/layer.h" 33 #include "ui/compositor/layer.h"
33 #include "ui/compositor/layer_animation_observer.h" 34 #include "ui/compositor/layer_animation_observer.h"
34 #include "ui/compositor/layer_animator.h" 35 #include "ui/compositor/layer_animator.h"
35 #include "ui/compositor/scoped_layer_animation_settings.h" 36 #include "ui/compositor/scoped_layer_animation_settings.h"
36 #include "ui/display/display.h" 37 #include "ui/display/display.h"
37 #include "ui/display/screen.h" 38 #include "ui/display/screen.h"
38 #include "ui/events/event.h" 39 #include "ui/events/event.h"
39 #include "ui/events/event_handler.h" 40 #include "ui/events/event_handler.h"
40 #include "ui/keyboard/keyboard_controller.h" 41 #include "ui/keyboard/keyboard_controller.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ShelfLayoutManager::~ShelfLayoutManager() { 167 ShelfLayoutManager::~ShelfLayoutManager() {
167 if (update_shelf_observer_) 168 if (update_shelf_observer_)
168 update_shelf_observer_->Detach(); 169 update_shelf_observer_->Detach();
169 170
170 for (auto& observer : observers_) 171 for (auto& observer : observers_)
171 observer.WillDeleteShelfLayoutManager(); 172 observer.WillDeleteShelfLayoutManager();
172 Shell::Get()->RemoveShellObserver(this); 173 Shell::Get()->RemoveShellObserver(this);
173 ShellPort::Get()->RemoveLockStateObserver(this); 174 ShellPort::Get()->RemoveLockStateObserver(this);
174 } 175 }
175 176
177 void ShelfLayoutManager::OnAppListIsActive() {
178 MaybeUpdateShelfBackground(AnimationChangeType::IMMEDIATE);
179 }
180
176 void ShelfLayoutManager::PrepareForShutdown() { 181 void ShelfLayoutManager::PrepareForShutdown() {
177 in_shutdown_ = true; 182 in_shutdown_ = true;
178 // Stop observing changes to avoid updating a partially destructed shelf. 183 // Stop observing changes to avoid updating a partially destructed shelf.
179 Shell::Get()->activation_client()->RemoveObserver(this); 184 Shell::Get()->activation_client()->RemoveObserver(this);
180 } 185 }
181 186
182 bool ShelfLayoutManager::IsVisible() const { 187 bool ShelfLayoutManager::IsVisible() const {
183 // status_area_widget() may be nullptr during the shutdown. 188 // status_area_widget() may be nullptr during the shutdown.
184 return shelf_widget_->status_area_widget() && 189 return shelf_widget_->status_area_widget() &&
185 shelf_widget_->status_area_widget()->IsVisible() && 190 shelf_widget_->status_area_widget()->IsVisible() &&
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 } 466 }
462 467
463 ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const { 468 ShelfBackgroundType ShelfLayoutManager::GetShelfBackgroundType() const {
464 if (state_.pre_lock_screen_animation_active) 469 if (state_.pre_lock_screen_animation_active)
465 return SHELF_BACKGROUND_DEFAULT; 470 return SHELF_BACKGROUND_DEFAULT;
466 471
467 // Handle all non active screen states, including OOBE and pre-login. 472 // Handle all non active screen states, including OOBE and pre-login.
468 if (state_.session_state != session_manager::SessionState::ACTIVE) 473 if (state_.session_state != session_manager::SessionState::ACTIVE)
469 return SHELF_BACKGROUND_OVERLAP; 474 return SHELF_BACKGROUND_OVERLAP;
470 475
476 // If the app list is active, hide the shelf background to prevent overlap.
477 if (shelf_widget_->IsShowingAppList() &&
478 app_list::features::IsFullscreenAppListEnabled())
479 return SHELF_BACKGROUND_DEFAULT;
480
471 if (state_.visibility_state != SHELF_AUTO_HIDE && 481 if (state_.visibility_state != SHELF_AUTO_HIDE &&
472 state_.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED) { 482 state_.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED) {
473 return SHELF_BACKGROUND_MAXIMIZED; 483 return SHELF_BACKGROUND_MAXIMIZED;
474 } 484 }
475 485
476 if (gesture_drag_status_ == GESTURE_DRAG_IN_PROGRESS || 486 if (gesture_drag_status_ == GESTURE_DRAG_IN_PROGRESS ||
477 window_overlaps_shelf_ || state_.visibility_state == SHELF_AUTO_HIDE) { 487 window_overlaps_shelf_ || state_.visibility_state == SHELF_AUTO_HIDE) {
478 return SHELF_BACKGROUND_OVERLAP; 488 return SHELF_BACKGROUND_OVERLAP;
479 } 489 }
480 490
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 gesture_drag_status_ = GESTURE_DRAG_NONE; 1163 gesture_drag_status_ = GESTURE_DRAG_NONE;
1154 } 1164 }
1155 1165
1156 void ShelfLayoutManager::CancelGestureDrag() { 1166 void ShelfLayoutManager::CancelGestureDrag() {
1157 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; 1167 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS;
1158 UpdateVisibilityState(); 1168 UpdateVisibilityState();
1159 gesture_drag_status_ = GESTURE_DRAG_NONE; 1169 gesture_drag_status_ = GESTURE_DRAG_NONE;
1160 } 1170 }
1161 1171
1162 } // namespace ash 1172 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698