| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/wm_shelf.h" | 5 #include "ash/shelf/wm_shelf.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/config.h" | 7 #include "ash/public/cpp/config.h" |
| 8 #include "ash/public/cpp/shelf_item_delegate.h" | 8 #include "ash/public/cpp/shelf_item_delegate.h" |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 11 #include "ash/session/session_controller.h" |
| 11 #include "ash/shelf/shelf_bezel_event_handler.h" | 12 #include "ash/shelf/shelf_bezel_event_handler.h" |
| 12 #include "ash/shelf/shelf_controller.h" | 13 #include "ash/shelf/shelf_controller.h" |
| 13 #include "ash/shelf/shelf_layout_manager.h" | 14 #include "ash/shelf/shelf_layout_manager.h" |
| 14 #include "ash/shelf/shelf_locking_manager.h" | 15 #include "ash/shelf/shelf_locking_manager.h" |
| 15 #include "ash/shelf/shelf_model.h" | 16 #include "ash/shelf/shelf_model.h" |
| 16 #include "ash/shelf/shelf_widget.h" | 17 #include "ash/shelf/shelf_widget.h" |
| 17 #include "ash/shelf/wm_shelf_observer.h" | 18 #include "ash/shelf/wm_shelf_observer.h" |
| 18 #include "ash/shell.h" | 19 #include "ash/shell.h" |
| 19 #include "ash/system/tray/system_tray_delegate.h" | 20 #include "ash/system/tray/system_tray_delegate.h" |
| 20 #include "ash/wm_window.h" | 21 #include "ash/wm_window.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 WmShelf::~WmShelf() {} | 70 WmShelf::~WmShelf() {} |
| 70 | 71 |
| 71 // static | 72 // static |
| 72 WmShelf* WmShelf::ForWindow(WmWindow* window) { | 73 WmShelf* WmShelf::ForWindow(WmWindow* window) { |
| 73 return window->GetRootWindowController()->GetShelf(); | 74 return window->GetRootWindowController()->GetShelf(); |
| 74 } | 75 } |
| 75 | 76 |
| 76 // static | 77 // static |
| 77 bool WmShelf::CanChangeShelfAlignment() { | 78 bool WmShelf::CanChangeShelfAlignment() { |
| 78 if (Shell::Get()->system_tray_delegate()->IsUserSupervised()) | 79 if (Shell::Get()->session_controller()->IsUserSupervised()) |
| 79 return false; | 80 return false; |
| 80 | 81 |
| 81 LoginStatus login_status = | 82 LoginStatus login_status = |
| 82 Shell::Get()->system_tray_delegate()->GetUserLoginStatus(); | 83 Shell::Get()->system_tray_delegate()->GetUserLoginStatus(); |
| 83 | 84 |
| 84 switch (login_status) { | 85 switch (login_status) { |
| 85 case LoginStatus::LOCKED: | 86 case LoginStatus::LOCKED: |
| 86 // Shelf alignment changes can be requested while being locked, but will | 87 // Shelf alignment changes can be requested while being locked, but will |
| 87 // be applied upon unlock. | 88 // be applied upon unlock. |
| 88 case LoginStatus::USER: | 89 case LoginStatus::USER: |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 375 |
| 375 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, | 376 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, |
| 376 AnimationChangeType change_type) { | 377 AnimationChangeType change_type) { |
| 377 if (background_type == GetBackgroundType()) | 378 if (background_type == GetBackgroundType()) |
| 378 return; | 379 return; |
| 379 for (auto& observer : observers_) | 380 for (auto& observer : observers_) |
| 380 observer.OnBackgroundTypeChanged(background_type, change_type); | 381 observer.OnBackgroundTypeChanged(background_type, change_type); |
| 381 } | 382 } |
| 382 | 383 |
| 383 } // namespace ash | 384 } // namespace ash |
| OLD | NEW |