1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
ash / system / tray / system_tray_notifier.cc [blame]
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/ime/ime_observer.h"
#include "ash/system/network/network_observer.h"
#include "ash/system/privacy/screen_security_observer.h"
#include "ash/system/tray/system_tray_observer.h"
#include "ash/system/tray/tray_bubble_view.h"
#include "ash/system/virtual_keyboard/virtual_keyboard_observer.h"
namespace ash {
SystemTrayNotifier::SystemTrayNotifier() = default;
SystemTrayNotifier::~SystemTrayNotifier() = default;
void SystemTrayNotifier::AddIMEObserver(IMEObserver* observer) {
ime_observers_.AddObserver(observer);
}
void SystemTrayNotifier::RemoveIMEObserver(IMEObserver* observer) {
ime_observers_.RemoveObserver(observer);
}
void SystemTrayNotifier::NotifyRefreshIME() {
for (auto& observer : ime_observers_)
observer.OnIMERefresh();
}
void SystemTrayNotifier::NotifyRefreshIMEMenu(bool is_active) {
for (auto& observer : ime_observers_)
observer.OnIMEMenuActivationChanged(is_active);
}
void SystemTrayNotifier::AddNetworkObserver(NetworkObserver* observer) {
network_observers_.AddObserver(observer);
}
void SystemTrayNotifier::RemoveNetworkObserver(NetworkObserver* observer) {
network_observers_.RemoveObserver(observer);
}
void SystemTrayNotifier::NotifyRequestToggleWifi() {
for (auto& observer : network_observers_)
observer.RequestToggleWifi();
}
void SystemTrayNotifier::AddScreenSecurityObserver(
ScreenSecurityObserver* observer) {
screen_security_observers_.AddObserver(observer);
}
void SystemTrayNotifier::RemoveScreenSecurityObserver(
ScreenSecurityObserver* observer) {
screen_security_observers_.RemoveObserver(observer);
}
void SystemTrayNotifier::NotifyScreenAccessStart(
base::RepeatingClosure stop_callback,
base::RepeatingClosure source_callback,
const std::u16string& access_app_name) {
for (auto& observer : screen_security_observers_) {
observer.OnScreenAccessStart(stop_callback, source_callback,
access_app_name);
}
}
void SystemTrayNotifier::NotifyScreenAccessStop() {
for (auto& observer : screen_security_observers_) {
observer.OnScreenAccessStop();
}
}
void SystemTrayNotifier::NotifyRemotingScreenShareStart(
base::RepeatingClosure stop_callback) {
for (auto& observer : screen_security_observers_) {
observer.OnRemotingScreenShareStart(stop_callback);
}
}
void SystemTrayNotifier::NotifyRemotingScreenShareStop() {
for (auto& observer : screen_security_observers_) {
observer.OnRemotingScreenShareStop();
}
}
void SystemTrayNotifier::AddSystemTrayObserver(SystemTrayObserver* observer) {
system_tray_observers_.AddObserver(observer);
}
void SystemTrayNotifier::RemoveSystemTrayObserver(
SystemTrayObserver* observer) {
system_tray_observers_.RemoveObserver(observer);
}
void SystemTrayNotifier::NotifyFocusOut(bool reverse) {
for (auto& observer : system_tray_observers_)
observer.OnFocusLeavingSystemTray(reverse);
}
void SystemTrayNotifier::NotifySystemTrayBubbleShown() {
for (auto& observer : system_tray_observers_)
observer.OnSystemTrayBubbleShown();
}
void SystemTrayNotifier::NotifyStatusAreaAnchoredBubbleVisibilityChanged(
TrayBubbleView* tray_bubble,
bool visible) {
for (auto& observer : system_tray_observers_) {
observer.OnStatusAreaAnchoredBubbleVisibilityChanged(tray_bubble, visible);
}
}
void SystemTrayNotifier::NotifyTrayBubbleBoundsChanged(
TrayBubbleView* tray_bubble) {
for (auto& observer : system_tray_observers_) {
observer.OnTrayBubbleBoundsChanged(tray_bubble);
}
}
void SystemTrayNotifier::NotifyImeMenuTrayBubbleShown() {
for (auto& observer : system_tray_observers_) {
observer.OnImeMenuTrayBubbleShown();
}
}
void SystemTrayNotifier::AddVirtualKeyboardObserver(
VirtualKeyboardObserver* observer) {
virtual_keyboard_observers_.AddObserver(observer);
}
void SystemTrayNotifier::RemoveVirtualKeyboardObserver(
VirtualKeyboardObserver* observer) {
virtual_keyboard_observers_.RemoveObserver(observer);
}
void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged(
bool suppressed) {
for (auto& observer : virtual_keyboard_observers_)
observer.OnKeyboardSuppressionChanged(suppressed);
}
} // namespace ash