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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 231123002: Notify about major session changes events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit_tests Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/test/test_session_state_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 6d72a4a9221cb0485d83fe24a1a4cd1eca04cf9f..789c884c5ce5b495e08ff7cb02dd677495b5d3a1 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -205,6 +205,7 @@ ShelfLayoutManager::ShelfLayoutManager(ShelfWidget* shelf)
Shell::GetInstance()->AddShellObserver(this);
Shell::GetInstance()->lock_state_controller()->AddObserver(this);
aura::client::GetActivationClient(root_window_)->AddObserver(this);
+ Shell::GetInstance()->session_state_delegate()->AddSessionStateObserver(this);
}
ShelfLayoutManager::~ShelfLayoutManager() {
@@ -215,6 +216,8 @@ ShelfLayoutManager::~ShelfLayoutManager() {
Shell::GetInstance()->RemoveShellObserver(this);
Shell::GetInstance()->lock_state_controller()->RemoveObserver(this);
aura::client::GetActivationClient(root_window_)->RemoveObserver(this);
+ Shell::GetInstance()->
+ session_state_delegate()->RemoveSessionStateObserver(this);
}
void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) {
@@ -732,11 +735,16 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity(
status_bounds));
SessionStateDelegate* session_state_delegate =
Shell::GetInstance()->session_state_delegate();
- if (!state_.is_screen_locked &&
- (session_state_delegate->IsActiveUserSessionStarted() ||
- !keyboard_bounds_.IsEmpty())) {
- Shell::GetInstance()->SetDisplayWorkAreaInsets(
- root_window_, target_bounds.work_area_insets);
+ if (!state_.is_screen_locked) {
+ gfx::Insets insets;
+ // If user session is blocked (login to new user session or add user to
+ // the existing session - multi-profile) then give 100% of work area only if
+ // keyboard is not shown.
+ if (!session_state_delegate->IsUserSessionBlocked() ||
+ !keyboard_bounds_.IsEmpty()) {
+ insets = target_bounds.work_area_insets;
+ }
+ Shell::GetInstance()->SetDisplayWorkAreaInsets(root_window_, insets);
}
}
@@ -1133,7 +1141,7 @@ void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) {
// On login screen if keyboard has been just hidden, update bounds just once
// but ignore target_bounds.work_area_insets since shelf overlaps with login
// window.
- if (!session_state_delegate->IsActiveUserSessionStarted() &&
+ if (session_state_delegate->IsUserSessionBlocked() &&
keyboard_is_about_to_hide) {
Shell::GetInstance()->SetDisplayWorkAreaInsets(root_window_, gfx::Insets());
}
@@ -1168,4 +1176,12 @@ void ShelfLayoutManager::OnLockStateEvent(LockStateObserver::EventType event) {
}
}
+void ShelfLayoutManager::SessionStateChanged(
+ SessionStateDelegate::SessionState state) {
+ TargetBounds target_bounds;
+ CalculateTargetBounds(state_, &target_bounds);
+ UpdateBoundsAndOpacity(target_bounds, true, NULL);
+ UpdateVisibilityState();
+}
+
} // namespace ash
« no previous file with comments | « ash/shelf/shelf_layout_manager.h ('k') | ash/test/test_session_state_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698