Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: components/exo/wm_helper.cc

Issue 2396883003: exo: Fix dragging edge cases (Closed)
Patch Set: Fix presubmit errors Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/exo/wm_helper.cc
diff --git a/components/exo/wm_helper.cc b/components/exo/wm_helper.cc
index 517a4ae414518b419f024c780dee897db8cef52a..e5191ed9dcb2876a8d3d50765942ceb5d91f0553 100644
--- a/components/exo/wm_helper.cc
+++ b/components/exo/wm_helper.cc
@@ -54,12 +54,12 @@ void WMHelper::RemoveCursorObserver(CursorObserver* observer) {
cursor_observers_.RemoveObserver(observer);
}
-void WMHelper::AddMaximizeModeObserver(MaximizeModeObserver* observer) {
- maximize_mode_observers_.AddObserver(observer);
+void WMHelper::AddShellObserver(ShellObserver* observer) {
+ shell_observers_.AddObserver(observer);
}
-void WMHelper::RemoveMaximizeModeObserver(MaximizeModeObserver* observer) {
- maximize_mode_observers_.RemoveObserver(observer);
+void WMHelper::RemoveShellObserver(ShellObserver* observer) {
+ shell_observers_.RemoveObserver(observer);
}
void WMHelper::AddAccessibilityObserver(AccessibilityObserver* observer) {
@@ -72,39 +72,49 @@ void WMHelper::RemoveAccessibilityObserver(AccessibilityObserver* observer) {
void WMHelper::NotifyWindowActivated(aura::Window* gained_active,
aura::Window* lost_active) {
- FOR_EACH_OBSERVER(ActivationObserver, activation_observers_,
- OnWindowActivated(gained_active, lost_active));
+ for (ActivationObserver& observer : activation_observers_)
+ observer.OnWindowActivated(gained_active, lost_active);
}
void WMHelper::NotifyWindowFocused(aura::Window* gained_focus,
aura::Window* lost_focus) {
- FOR_EACH_OBSERVER(FocusObserver, focus_observers_,
- OnWindowFocused(gained_focus, lost_focus));
+ for (FocusObserver& observer : focus_observers_)
+ observer.OnWindowFocused(gained_focus, lost_focus);
}
void WMHelper::NotifyCursorVisibilityChanged(bool is_visible) {
- FOR_EACH_OBSERVER(CursorObserver, cursor_observers_,
- OnCursorVisibilityChanged(is_visible));
+ for (CursorObserver& observer : cursor_observers_)
+ observer.OnCursorVisibilityChanged(is_visible);
}
void WMHelper::NotifyCursorSetChanged(ui::CursorSetType cursor_set) {
- FOR_EACH_OBSERVER(CursorObserver, cursor_observers_,
- OnCursorSetChanged(cursor_set));
+ for (CursorObserver& observer : cursor_observers_)
+ observer.OnCursorSetChanged(cursor_set);
}
void WMHelper::NotifyMaximizeModeStarted() {
- FOR_EACH_OBSERVER(MaximizeModeObserver, maximize_mode_observers_,
- OnMaximizeModeStarted());
+ for (ShellObserver& observer : shell_observers_)
+ observer.OnMaximizeModeStarted();
}
void WMHelper::NotifyMaximizeModeEnded() {
- FOR_EACH_OBSERVER(MaximizeModeObserver, maximize_mode_observers_,
- OnMaximizeModeEnded());
+ for (ShellObserver& observer : shell_observers_)
+ observer.OnMaximizeModeEnded();
+}
+
+void WMHelper::NotifyOverviewModeStarted() {
+ for (ShellObserver& observer : shell_observers_)
+ observer.OnOverviewModeStarted();
+}
+
+void WMHelper::NotifyOverviewModeEnded() {
+ for (ShellObserver& observer : shell_observers_)
+ observer.OnOverviewModeEnded();
}
void WMHelper::NotifyAccessibilityModeChanged() {
- FOR_EACH_OBSERVER(AccessibilityObserver, accessibility_observers_,
- OnAccessibilityModeChanged());
+ for (AccessibilityObserver& observer : accessibility_observers_)
+ observer.OnAccessibilityModeChanged();
}
} // namespace exo

Powered by Google App Engine
This is Rietveld 408576698