OLD | NEW |
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/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 664 |
665 bool ShelfWidget::IsShelfHiddenBehindBlackBar() const { | 665 bool ShelfWidget::IsShelfHiddenBehindBlackBar() const { |
666 return delegate_view_->opaque_foreground()->GetTargetOpacity() != 0.0f; | 666 return delegate_view_->opaque_foreground()->GetTargetOpacity() != 0.0f; |
667 } | 667 } |
668 | 668 |
669 // static | 669 // static |
670 bool ShelfWidget::ShelfAlignmentAllowed() { | 670 bool ShelfWidget::ShelfAlignmentAllowed() { |
671 if (Shell::GetInstance()->system_tray_delegate()->IsUserSupervised()) | 671 if (Shell::GetInstance()->system_tray_delegate()->IsUserSupervised()) |
672 return false; | 672 return false; |
673 | 673 |
674 user::LoginStatus login_status = | 674 LoginStatus login_status = |
675 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); | 675 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); |
676 | 676 |
677 switch (login_status) { | 677 switch (login_status) { |
678 case user::LOGGED_IN_LOCKED: | 678 case LoginStatus::LOCKED: |
679 // Shelf alignment changes can be requested while being locked, but will | 679 // Shelf alignment changes can be requested while being locked, but will |
680 // be applied upon unlock. | 680 // be applied upon unlock. |
681 case user::LOGGED_IN_USER: | 681 case LoginStatus::USER: |
682 case user::LOGGED_IN_OWNER: | 682 case LoginStatus::OWNER: |
683 return true; | 683 return true; |
684 case user::LOGGED_IN_PUBLIC: | 684 case LoginStatus::PUBLIC: |
685 case user::LOGGED_IN_SUPERVISED: | 685 case LoginStatus::SUPERVISED: |
686 case user::LOGGED_IN_GUEST: | 686 case LoginStatus::GUEST: |
687 case user::LOGGED_IN_KIOSK_APP: | 687 case LoginStatus::KIOSK_APP: |
688 case user::LOGGED_IN_NONE: | 688 case LoginStatus::NOT_LOGGED_IN: |
689 return false; | 689 return false; |
690 } | 690 } |
691 | 691 |
692 NOTREACHED(); | 692 NOTREACHED(); |
693 return false; | 693 return false; |
694 } | 694 } |
695 | 695 |
696 ShelfAlignment ShelfWidget::GetAlignment() const { | 696 ShelfAlignment ShelfWidget::GetAlignment() const { |
697 // TODO(msw): This should not be called before |shelf_| is created. | 697 // TODO(msw): This should not be called before |shelf_| is created. |
698 return shelf_ ? shelf_->alignment() : SHELF_ALIGNMENT_BOTTOM_LOCKED; | 698 return shelf_ ? shelf_->alignment() : SHELF_ALIGNMENT_BOTTOM_LOCKED; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); | 814 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); |
815 } | 815 } |
816 | 816 |
817 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { | 817 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { |
818 Widget::OnGestureEvent(event); | 818 Widget::OnGestureEvent(event); |
819 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) | 819 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) |
820 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); | 820 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); |
821 } | 821 } |
822 | 822 |
823 } // namespace ash | 823 } // namespace ash |
OLD | NEW |