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

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

Issue 2041233005: Moves ash::user::LoginStatus to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 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
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_widget.h" 5 #include "ash/shelf/shelf_widget.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/aura/wm_shelf_aura.h" 8 #include "ash/aura/wm_shelf_aura.h"
9 #include "ash/aura/wm_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 663
664 bool ShelfWidget::IsShelfHiddenBehindBlackBar() const { 664 bool ShelfWidget::IsShelfHiddenBehindBlackBar() const {
665 return delegate_view_->opaque_foreground()->GetTargetOpacity() != 0.0f; 665 return delegate_view_->opaque_foreground()->GetTargetOpacity() != 0.0f;
666 } 666 }
667 667
668 // static 668 // static
669 bool ShelfWidget::ShelfAlignmentAllowed() { 669 bool ShelfWidget::ShelfAlignmentAllowed() {
670 if (Shell::GetInstance()->system_tray_delegate()->IsUserSupervised()) 670 if (Shell::GetInstance()->system_tray_delegate()->IsUserSupervised())
671 return false; 671 return false;
672 672
673 user::LoginStatus login_status = 673 LoginStatus login_status =
674 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); 674 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus();
675 675
676 switch (login_status) { 676 switch (login_status) {
677 case user::LOGGED_IN_LOCKED: 677 case LoginStatus::LOCKED:
678 // Shelf alignment changes can be requested while being locked, but will 678 // Shelf alignment changes can be requested while being locked, but will
679 // be applied upon unlock. 679 // be applied upon unlock.
680 case user::LOGGED_IN_USER: 680 case LoginStatus::USER:
681 case user::LOGGED_IN_OWNER: 681 case LoginStatus::OWNER:
682 return true; 682 return true;
683 case user::LOGGED_IN_PUBLIC: 683 case LoginStatus::PUBLIC:
684 case user::LOGGED_IN_SUPERVISED: 684 case LoginStatus::SUPERVISED:
685 case user::LOGGED_IN_GUEST: 685 case LoginStatus::GUEST:
686 case user::LOGGED_IN_KIOSK_APP: 686 case LoginStatus::KIOSK_APP:
687 case user::LOGGED_IN_NONE: 687 case LoginStatus::NOT_LOGGED_IN:
688 return false; 688 return false;
689 } 689 }
690 690
691 NOTREACHED(); 691 NOTREACHED();
692 return false; 692 return false;
693 } 693 }
694 694
695 ShelfAlignment ShelfWidget::GetAlignment() const { 695 ShelfAlignment ShelfWidget::GetAlignment() const {
696 // TODO(msw): This should not be called before |shelf_| is created. 696 // TODO(msw): This should not be called before |shelf_| is created.
697 return shelf_ ? shelf_->alignment() : SHELF_ALIGNMENT_BOTTOM_LOCKED; 697 return shelf_ ? shelf_->alignment() : SHELF_ALIGNMENT_BOTTOM_LOCKED;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); 813 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event);
814 } 814 }
815 815
816 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { 816 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) {
817 Widget::OnGestureEvent(event); 817 Widget::OnGestureEvent(event);
818 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) 818 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_)
819 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); 819 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event);
820 } 820 }
821 821
822 } // namespace ash 822 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698