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
ash / system / model / system_tray_model.h [blame]
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_SYSTEM_MODEL_SYSTEM_TRAY_MODEL_H_
#define ASH_SYSTEM_MODEL_SYSTEM_TRAY_MODEL_H_
#include <memory>
#include "ash/ash_export.h"
#include "ash/public/cpp/system_tray.h"
#include "ash/system/time/calendar_model.h"
#include "base/memory/raw_ptr.h"
namespace ash {
class ActiveNetworkIcon;
class ClockModel;
class EnterpriseDomainModel;
class LocaleModel;
struct RelaunchNotificationState;
class SessionLengthLimitModel;
class SystemTrayClient;
class TracingModel;
class TrayNetworkStateModel;
class UpdateModel;
class VirtualKeyboardModel;
class CalendarListModel;
class CalendarModel;
namespace phonehub {
class PhoneHubManager;
}
// Top level model of SystemTray.
class ASH_EXPORT SystemTrayModel : public SystemTray {
public:
SystemTrayModel();
SystemTrayModel(const SystemTrayModel&) = delete;
SystemTrayModel& operator=(const SystemTrayModel&) = delete;
~SystemTrayModel() override;
// SystemTray:
void SetClient(SystemTrayClient* client) override;
void SetPrimaryTrayEnabled(bool enabled) override;
void SetPrimaryTrayVisible(bool visible) override;
void SetUse24HourClock(bool use_24_hour) override;
void SetDeviceEnterpriseInfo(
const DeviceEnterpriseInfo& device_enterprise_info) override;
void SetEnterpriseAccountDomainInfo(
const std::string& account_domain_manager) override;
void SetPerformanceTracingIconVisible(bool visible) override;
void SetLocaleList(std::vector<LocaleInfo> locale_list,
const std::string& current_locale_iso_code) override;
void ShowUpdateIcon(UpdateSeverity severity,
bool factory_reset_required,
bool rollback) override;
void SetRelaunchNotificationState(
const RelaunchNotificationState& relaunch_notification_state) override;
void ResetUpdateState() override;
void SetUpdateDeferred(DeferredUpdateState state) override;
void SetUpdateOverCellularAvailableIconVisible(bool visible) override;
void SetShowEolNotice(bool show) override;
void SetShowExtendedUpdatesNotice(bool show) override;
void ShowVolumeSliderBubble() override;
void ShowNetworkDetailedViewBubble() override;
void SetPhoneHubManager(
phonehub::PhoneHubManager* phone_hub_manager) override;
// This will be set to true in `FakeSystemTrayModel`.
virtual bool IsFakeModel() const;
// True if user is in a child session. Virtual for mocking.
virtual bool IsInUserChildSession() const;
ClockModel* clock() { return clock_.get(); }
EnterpriseDomainModel* enterprise_domain() {
return enterprise_domain_.get();
}
LocaleModel* locale() { return locale_.get(); }
SessionLengthLimitModel* session_length_limit() {
return session_length_limit_.get();
}
TracingModel* tracing() { return tracing_.get(); }
UpdateModel* update_model() { return update_model_.get(); }
VirtualKeyboardModel* virtual_keyboard() { return virtual_keyboard_.get(); }
TrayNetworkStateModel* network_state_model() {
return network_state_model_.get();
}
ActiveNetworkIcon* active_network_icon() {
return active_network_icon_.get();
}
SystemTrayClient* client() { return client_; }
CalendarListModel* calendar_list_model() {
return calendar_list_model_.get();
}
CalendarModel* calendar_model() { return calendar_model_.get(); }
phonehub::PhoneHubManager* phone_hub_manager() { return phone_hub_manager_; }
private:
std::unique_ptr<ClockModel> clock_;
std::unique_ptr<EnterpriseDomainModel> enterprise_domain_;
std::unique_ptr<LocaleModel> locale_;
std::unique_ptr<SessionLengthLimitModel> session_length_limit_;
std::unique_ptr<TracingModel> tracing_;
std::unique_ptr<UpdateModel> update_model_;
std::unique_ptr<VirtualKeyboardModel> virtual_keyboard_;
std::unique_ptr<TrayNetworkStateModel> network_state_model_;
std::unique_ptr<ActiveNetworkIcon> active_network_icon_;
std::unique_ptr<CalendarListModel> calendar_list_model_;
std::unique_ptr<CalendarModel> calendar_model_;
// Client interface in chrome browser. May be null in tests.
raw_ptr<SystemTrayClient> client_ = nullptr;
// Unowned.
raw_ptr<phonehub::PhoneHubManager> phone_hub_manager_ = nullptr;
};
} // namespace ash
#endif // ASH_SYSTEM_MODEL_SYSTEM_TRAY_MODEL_H_