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

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

Issue 2416253004: ash: Use session_manager::SessionState (Closed)
Patch Set: fix compile Created 4 years, 2 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/common/shelf/shelf_layout_manager.h" 5 #include "ash/common/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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 961
962 void ShelfLayoutManager::OnLockStateEvent(LockStateObserver::EventType event) { 962 void ShelfLayoutManager::OnLockStateEvent(LockStateObserver::EventType event) {
963 if (event == EVENT_LOCK_ANIMATION_STARTED) { 963 if (event == EVENT_LOCK_ANIMATION_STARTED) {
964 // Enter the screen locked state and update the visibility to avoid an odd 964 // Enter the screen locked state and update the visibility to avoid an odd
965 // animation when transitioning the orientation from L/R to bottom. 965 // animation when transitioning the orientation from L/R to bottom.
966 state_.is_screen_locked = true; 966 state_.is_screen_locked = true;
967 UpdateShelfVisibilityAfterLoginUIChange(); 967 UpdateShelfVisibilityAfterLoginUIChange();
968 } 968 }
969 } 969 }
970 970
971 void ShelfLayoutManager::SessionStateChanged( 971 void ShelfLayoutManager::SessionStateChanged(SessionState state) {
972 SessionStateDelegate::SessionState state) {
973 // Check transition changes to/from the add user to session and change the 972 // Check transition changes to/from the add user to session and change the
974 // shelf alignment accordingly 973 // shelf alignment accordingly
975 bool add_user = state == SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY; 974 const bool add_user = state == SessionState::LOGIN_SECONDARY;
976 if (add_user != state_.is_adding_user_screen) { 975 if (add_user != state_.is_adding_user_screen) {
977 state_.is_adding_user_screen = add_user; 976 state_.is_adding_user_screen = add_user;
978 UpdateShelfVisibilityAfterLoginUIChange(); 977 UpdateShelfVisibilityAfterLoginUIChange();
979 return; 978 return;
980 } 979 }
981 TargetBounds target_bounds; 980 TargetBounds target_bounds;
982 CalculateTargetBounds(state_, &target_bounds); 981 CalculateTargetBounds(state_, &target_bounds);
983 UpdateBoundsAndOpacity(target_bounds, true /* animate */, 982 UpdateBoundsAndOpacity(target_bounds, true /* animate */,
984 true /* change_work_area */, NULL); 983 true /* change_work_area */, NULL);
985 UpdateVisibilityState(); 984 UpdateVisibilityState();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 gesture_drag_status_ = GESTURE_DRAG_NONE; 1101 gesture_drag_status_ = GESTURE_DRAG_NONE;
1103 } 1102 }
1104 1103
1105 void ShelfLayoutManager::CancelGestureDrag() { 1104 void ShelfLayoutManager::CancelGestureDrag() {
1106 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; 1105 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS;
1107 UpdateVisibilityState(); 1106 UpdateVisibilityState();
1108 gesture_drag_status_ = GESTURE_DRAG_NONE; 1107 gesture_drag_status_ = GESTURE_DRAG_NONE;
1109 } 1108 }
1110 1109
1111 } // namespace ash 1110 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698