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" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 WmShelf::WmShelf() : shelf_locking_manager_(this) { | 66 WmShelf::WmShelf() : shelf_locking_manager_(this) { |
67 // TODO: ShelfBezelEventHandler needs to work with mus too. | 67 // TODO: ShelfBezelEventHandler needs to work with mus too. |
68 // http://crbug.com/636647 | 68 // http://crbug.com/636647 |
69 if (Shell::GetAshConfig() != Config::MASH) | 69 if (Shell::GetAshConfig() != Config::MASH) |
70 bezel_event_handler_ = base::MakeUnique<ShelfBezelEventHandler>(this); | 70 bezel_event_handler_ = base::MakeUnique<ShelfBezelEventHandler>(this); |
71 } | 71 } |
72 | 72 |
73 WmShelf::~WmShelf() {} | 73 WmShelf::~WmShelf() {} |
74 | 74 |
75 // static | 75 // static |
76 WmShelf* WmShelf::ForWindow(WmWindow* window) { | 76 WmShelf* WmShelf::ForWindow(aura::Window* window) { |
77 return window->GetRootWindowController()->GetShelf(); | 77 return GetRootWindowController(window->GetRootWindow())->GetShelf(); |
78 } | 78 } |
79 | 79 |
80 // static | 80 // static |
81 bool WmShelf::CanChangeShelfAlignment() { | 81 bool WmShelf::CanChangeShelfAlignment() { |
82 if (Shell::Get()->session_controller()->IsUserSupervised()) | 82 if (Shell::Get()->session_controller()->IsUserSupervised()) |
83 return false; | 83 return false; |
84 | 84 |
85 const LoginStatus login_status = | 85 const LoginStatus login_status = |
86 Shell::Get()->session_controller()->login_status(); | 86 Shell::Get()->session_controller()->login_status(); |
87 | 87 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 355 |
356 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, | 356 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, |
357 AnimationChangeType change_type) { | 357 AnimationChangeType change_type) { |
358 if (background_type == GetBackgroundType()) | 358 if (background_type == GetBackgroundType()) |
359 return; | 359 return; |
360 for (auto& observer : observers_) | 360 for (auto& observer : observers_) |
361 observer.OnBackgroundTypeChanged(background_type, change_type); | 361 observer.OnBackgroundTypeChanged(background_type, change_type); |
362 } | 362 } |
363 | 363 |
364 } // namespace ash | 364 } // namespace ash |
OLD | NEW |