| 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/wm/aura/wm_shelf_aura.h" | 5 #include "ash/aura/wm_shelf_aura.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" |
| 7 #include "ash/common/wm/shelf/wm_shelf_observer.h" | 8 #include "ash/common/wm/shelf/wm_shelf_observer.h" |
| 8 #include "ash/common/wm/wm_window.h" | 9 #include "ash/common/wm_window.h" |
| 9 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
| 11 #include "ash/wm/aura/wm_window_aura.h" | |
| 12 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget.h" |
| 13 | 13 |
| 14 namespace ash { | 14 namespace ash { |
| 15 namespace wm { | 15 namespace wm { |
| 16 | 16 |
| 17 WmShelfAura::WmShelfAura(Shelf* shelf) | 17 WmShelfAura::WmShelfAura(Shelf* shelf) |
| 18 : shelf_(shelf), shelf_layout_manager_(shelf->shelf_layout_manager()) { | 18 : shelf_(shelf), shelf_layout_manager_(shelf->shelf_layout_manager()) { |
| 19 shelf_layout_manager_->AddObserver(this); | 19 shelf_layout_manager_->AddObserver(this); |
| 20 shelf_->AddIconObserver(this); | 20 shelf_->AddIconObserver(this); |
| 21 } | 21 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 ShelfVisibilityState WmShelfAura::GetVisibilityState() const { | 50 ShelfVisibilityState WmShelfAura::GetVisibilityState() const { |
| 51 return shelf_layout_manager_ ? shelf_layout_manager_->visibility_state() | 51 return shelf_layout_manager_ ? shelf_layout_manager_->visibility_state() |
| 52 : SHELF_HIDDEN; | 52 : SHELF_HIDDEN; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void WmShelfAura::UpdateIconPositionForWindow(WmWindow* window) { | 55 void WmShelfAura::UpdateIconPositionForWindow(WmWindow* window) { |
| 56 shelf_->UpdateIconPositionForWindow(WmWindowAura::GetAuraWindow(window)); | 56 shelf_->UpdateIconPositionForWindow(WmWindowAura::GetAuraWindow(window)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 gfx::Rect WmShelfAura::GetScreenBoundsOfItemIconForWindow( | 59 gfx::Rect WmShelfAura::GetScreenBoundsOfItemIconForWindow(WmWindow* window) { |
| 60 wm::WmWindow* window) { | |
| 61 return shelf_->GetScreenBoundsOfItemIconForWindow( | 60 return shelf_->GetScreenBoundsOfItemIconForWindow( |
| 62 WmWindowAura::GetAuraWindow(window)); | 61 WmWindowAura::GetAuraWindow(window)); |
| 63 } | 62 } |
| 64 | 63 |
| 65 void WmShelfAura::AddObserver(WmShelfObserver* observer) { | 64 void WmShelfAura::AddObserver(WmShelfObserver* observer) { |
| 66 observers_.AddObserver(observer); | 65 observers_.AddObserver(observer); |
| 67 } | 66 } |
| 68 | 67 |
| 69 void WmShelfAura::RemoveObserver(WmShelfObserver* observer) { | 68 void WmShelfAura::RemoveObserver(WmShelfObserver* observer) { |
| 70 observers_.RemoveObserver(observer); | 69 observers_.RemoveObserver(observer); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 86 FOR_EACH_OBSERVER(WmShelfObserver, observers_, | 85 FOR_EACH_OBSERVER(WmShelfObserver, observers_, |
| 87 WillChangeVisibilityState(new_state)); | 86 WillChangeVisibilityState(new_state)); |
| 88 } | 87 } |
| 89 | 88 |
| 90 void WmShelfAura::OnShelfIconPositionsChanged() { | 89 void WmShelfAura::OnShelfIconPositionsChanged() { |
| 91 FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged()); | 90 FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged()); |
| 92 } | 91 } |
| 93 | 92 |
| 94 } // namespace wm | 93 } // namespace wm |
| 95 } // namespace ash | 94 } // namespace ash |
| OLD | NEW |