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

Side by Side Diff: components/exo/wm_helper.cc

Issue 2396883003: exo: Fix dragging edge cases (Closed)
Patch Set: Fix unit tests 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 unified diff | Download patch
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 void WMHelper::AddCursorObserver(CursorObserver* observer) { 49 void WMHelper::AddCursorObserver(CursorObserver* observer) {
50 cursor_observers_.AddObserver(observer); 50 cursor_observers_.AddObserver(observer);
51 } 51 }
52 52
53 void WMHelper::RemoveCursorObserver(CursorObserver* observer) { 53 void WMHelper::RemoveCursorObserver(CursorObserver* observer) {
54 cursor_observers_.RemoveObserver(observer); 54 cursor_observers_.RemoveObserver(observer);
55 } 55 }
56 56
57 void WMHelper::AddMaximizeModeObserver(MaximizeModeObserver* observer) { 57 void WMHelper::AddShellObserver(ShellObserver* observer) {
58 maximize_mode_observers_.AddObserver(observer); 58 shell_observers_.AddObserver(observer);
59 } 59 }
60 60
61 void WMHelper::RemoveMaximizeModeObserver(MaximizeModeObserver* observer) { 61 void WMHelper::RemoveShellObserver(ShellObserver* observer) {
62 maximize_mode_observers_.RemoveObserver(observer); 62 shell_observers_.RemoveObserver(observer);
63 } 63 }
64 64
65 void WMHelper::NotifyWindowActivated(aura::Window* gained_active, 65 void WMHelper::NotifyWindowActivated(aura::Window* gained_active,
66 aura::Window* lost_active) { 66 aura::Window* lost_active) {
67 FOR_EACH_OBSERVER(ActivationObserver, activation_observers_, 67 FOR_EACH_OBSERVER(ActivationObserver, activation_observers_,
68 OnWindowActivated(gained_active, lost_active)); 68 OnWindowActivated(gained_active, lost_active));
69 } 69 }
70 70
71 void WMHelper::NotifyWindowFocused(aura::Window* gained_focus, 71 void WMHelper::NotifyWindowFocused(aura::Window* gained_focus,
72 aura::Window* lost_focus) { 72 aura::Window* lost_focus) {
73 FOR_EACH_OBSERVER(FocusObserver, focus_observers_, 73 FOR_EACH_OBSERVER(FocusObserver, focus_observers_,
74 OnWindowFocused(gained_focus, lost_focus)); 74 OnWindowFocused(gained_focus, lost_focus));
75 } 75 }
76 76
77 void WMHelper::NotifyCursorVisibilityChanged(bool is_visible) { 77 void WMHelper::NotifyCursorVisibilityChanged(bool is_visible) {
78 FOR_EACH_OBSERVER(CursorObserver, cursor_observers_, 78 FOR_EACH_OBSERVER(CursorObserver, cursor_observers_,
79 OnCursorVisibilityChanged(is_visible)); 79 OnCursorVisibilityChanged(is_visible));
80 } 80 }
81 81
82 void WMHelper::NotifyCursorSetChanged(ui::CursorSetType cursor_set) { 82 void WMHelper::NotifyCursorSetChanged(ui::CursorSetType cursor_set) {
83 FOR_EACH_OBSERVER(CursorObserver, cursor_observers_, 83 FOR_EACH_OBSERVER(CursorObserver, cursor_observers_,
84 OnCursorSetChanged(cursor_set)); 84 OnCursorSetChanged(cursor_set));
85 } 85 }
86 86
87 void WMHelper::NotifyMaximizeModeStarted() { 87 void WMHelper::NotifyMaximizeModeStarted() {
88 FOR_EACH_OBSERVER(MaximizeModeObserver, maximize_mode_observers_, 88 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnMaximizeModeStarted());
89 OnMaximizeModeStarted());
90 } 89 }
91 90
92 void WMHelper::NotifyMaximizeModeEnded() { 91 void WMHelper::NotifyMaximizeModeEnded() {
93 FOR_EACH_OBSERVER(MaximizeModeObserver, maximize_mode_observers_, 92 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnMaximizeModeEnded());
94 OnMaximizeModeEnded()); 93 }
94
95 void WMHelper::NotifyOverviewModeStarted() {
96 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnOverviewModeStarted());
97 }
98
99 void WMHelper::NotifyOverviewModeEnded() {
100 FOR_EACH_OBSERVER(ShellObserver, shell_observers_, OnOverviewModeEnded());
95 } 101 }
96 102
97 } // namespace exo 103 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698