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 "components/exo/wm_helper.h" | 5 #include "components/exo/wm_helper.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 | 8 |
9 namespace exo { | 9 namespace exo { |
10 namespace { | 10 namespace { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void WMHelper::AddAccessibilityObserver(AccessibilityObserver* observer) { | 65 void WMHelper::AddAccessibilityObserver(AccessibilityObserver* observer) { |
66 accessibility_observers_.AddObserver(observer); | 66 accessibility_observers_.AddObserver(observer); |
67 } | 67 } |
68 | 68 |
69 void WMHelper::RemoveAccessibilityObserver(AccessibilityObserver* observer) { | 69 void WMHelper::RemoveAccessibilityObserver(AccessibilityObserver* observer) { |
70 accessibility_observers_.RemoveObserver(observer); | 70 accessibility_observers_.RemoveObserver(observer); |
71 } | 71 } |
72 | 72 |
73 void WMHelper::NotifyWindowActivated(aura::Window* gained_active, | 73 void WMHelper::NotifyWindowActivated(aura::Window* gained_active, |
74 aura::Window* lost_active) { | 74 aura::Window* lost_active) { |
75 FOR_EACH_OBSERVER(ActivationObserver, activation_observers_, | 75 for (ActivationObserver& observer : activation_observers_) |
76 OnWindowActivated(gained_active, lost_active)); | 76 observer.OnWindowActivated(gained_active, lost_active); |
77 } | 77 } |
78 | 78 |
79 void WMHelper::NotifyWindowFocused(aura::Window* gained_focus, | 79 void WMHelper::NotifyWindowFocused(aura::Window* gained_focus, |
80 aura::Window* lost_focus) { | 80 aura::Window* lost_focus) { |
81 FOR_EACH_OBSERVER(FocusObserver, focus_observers_, | 81 for (FocusObserver& observer : focus_observers_) |
82 OnWindowFocused(gained_focus, lost_focus)); | 82 observer.OnWindowFocused(gained_focus, lost_focus); |
83 } | 83 } |
84 | 84 |
85 void WMHelper::NotifyCursorVisibilityChanged(bool is_visible) { | 85 void WMHelper::NotifyCursorVisibilityChanged(bool is_visible) { |
86 FOR_EACH_OBSERVER(CursorObserver, cursor_observers_, | 86 for (CursorObserver& observer : cursor_observers_) |
87 OnCursorVisibilityChanged(is_visible)); | 87 observer.OnCursorVisibilityChanged(is_visible); |
88 } | 88 } |
89 | 89 |
90 void WMHelper::NotifyCursorSetChanged(ui::CursorSetType cursor_set) { | 90 void WMHelper::NotifyCursorSetChanged(ui::CursorSetType cursor_set) { |
91 FOR_EACH_OBSERVER(CursorObserver, cursor_observers_, | 91 for (CursorObserver& observer : cursor_observers_) |
92 OnCursorSetChanged(cursor_set)); | 92 observer.OnCursorSetChanged(cursor_set); |
93 } | 93 } |
94 | 94 |
95 void WMHelper::NotifyMaximizeModeStarted() { | 95 void WMHelper::NotifyMaximizeModeStarted() { |
96 FOR_EACH_OBSERVER(MaximizeModeObserver, maximize_mode_observers_, | 96 for (MaximizeModeObserver& observer : maximize_mode_observers_) |
97 OnMaximizeModeStarted()); | 97 observer.OnMaximizeModeStarted(); |
98 } | 98 } |
99 | 99 |
100 void WMHelper::NotifyMaximizeModeEnded() { | 100 void WMHelper::NotifyMaximizeModeEnded() { |
101 FOR_EACH_OBSERVER(MaximizeModeObserver, maximize_mode_observers_, | 101 for (MaximizeModeObserver& observer : maximize_mode_observers_) |
102 OnMaximizeModeEnded()); | 102 observer.OnMaximizeModeEnded(); |
103 } | 103 } |
104 | 104 |
105 void WMHelper::NotifyAccessibilityModeChanged() { | 105 void WMHelper::NotifyAccessibilityModeChanged() { |
106 FOR_EACH_OBSERVER(AccessibilityObserver, accessibility_observers_, | 106 for (AccessibilityObserver& observer : accessibility_observers_) |
107 OnAccessibilityModeChanged()); | 107 observer.OnAccessibilityModeChanged(); |
108 } | 108 } |
109 | 109 |
110 } // namespace exo | 110 } // namespace exo |
OLD | NEW |