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/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/aura/wm_window_aura.h" |
8 #include "ash/common/wm/shelf/wm_shelf_observer.h" | 8 #include "ash/common/shelf/wm_shelf_observer.h" |
9 #include "ash/common/wm_window.h" | 9 #include "ash/common/wm_window.h" |
10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
11 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.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 { | |
16 | 15 |
17 WmShelfAura::WmShelfAura(Shelf* shelf) | 16 WmShelfAura::WmShelfAura(Shelf* shelf) |
18 : shelf_(shelf), shelf_layout_manager_(shelf->shelf_layout_manager()) { | 17 : shelf_(shelf), shelf_layout_manager_(shelf->shelf_layout_manager()) { |
19 shelf_layout_manager_->AddObserver(this); | 18 shelf_layout_manager_->AddObserver(this); |
20 shelf_->AddIconObserver(this); | 19 shelf_->AddIconObserver(this); |
21 } | 20 } |
22 | 21 |
23 WmShelfAura::~WmShelfAura() { | 22 WmShelfAura::~WmShelfAura() { |
24 shelf_->RemoveIconObserver(this); | 23 shelf_->RemoveIconObserver(this); |
25 if (shelf_layout_manager_) | 24 if (shelf_layout_manager_) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void WmShelfAura::RemoveObserver(WmShelfObserver* observer) { | 67 void WmShelfAura::RemoveObserver(WmShelfObserver* observer) { |
69 observers_.RemoveObserver(observer); | 68 observers_.RemoveObserver(observer); |
70 } | 69 } |
71 | 70 |
72 void WmShelfAura::WillDeleteShelfLayoutManager() { | 71 void WmShelfAura::WillDeleteShelfLayoutManager() { |
73 shelf_layout_manager_->RemoveObserver(this); | 72 shelf_layout_manager_->RemoveObserver(this); |
74 shelf_layout_manager_ = nullptr; | 73 shelf_layout_manager_ = nullptr; |
75 } | 74 } |
76 | 75 |
77 void WmShelfAura::OnBackgroundUpdated( | 76 void WmShelfAura::OnBackgroundUpdated( |
78 wm::ShelfBackgroundType background_type, | 77 ShelfBackgroundType background_type, |
79 BackgroundAnimatorChangeType change_type) { | 78 BackgroundAnimatorChangeType change_type) { |
80 FOR_EACH_OBSERVER(WmShelfObserver, observers_, | 79 FOR_EACH_OBSERVER(WmShelfObserver, observers_, |
81 OnBackgroundUpdated(background_type, change_type)); | 80 OnBackgroundUpdated(background_type, change_type)); |
82 } | 81 } |
83 | 82 |
84 void WmShelfAura::WillChangeVisibilityState(ShelfVisibilityState new_state) { | 83 void WmShelfAura::WillChangeVisibilityState(ShelfVisibilityState new_state) { |
85 FOR_EACH_OBSERVER(WmShelfObserver, observers_, | 84 FOR_EACH_OBSERVER(WmShelfObserver, observers_, |
86 WillChangeVisibilityState(new_state)); | 85 WillChangeVisibilityState(new_state)); |
87 } | 86 } |
88 | 87 |
89 void WmShelfAura::OnShelfIconPositionsChanged() { | 88 void WmShelfAura::OnShelfIconPositionsChanged() { |
90 FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged()); | 89 FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged()); |
91 } | 90 } |
92 | 91 |
93 } // namespace wm | |
94 } // namespace ash | 92 } // namespace ash |
OLD | NEW |