1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/system/system_notifier.h"
7 #include "base/logging.h"
10 namespace system_notifier
{
14 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/
15 // system-notifications for the reasoning.
16 const char* kAlwaysShownNotifierIds
[] = {
18 kNotifierDisplayError
,
19 kNotifierNetworkError
,
21 // Note: Order doesn't matter here, so keep this in alphabetic order, don't
22 // just add your stuff at the end!
26 const char* kAshSystemNotifiers
[] = {
29 kNotifierDisplayError
,
30 kNotifierDisplayResolutionChange
,
32 kNotifierMultiProfileFirstRun
,
34 kNotifierNetworkError
,
35 kNotifierNetworkPortalDetector
,
38 kNotifierScreenCapture
,
40 kNotifierSessionLengthTimeout
,
41 kNotifierSupervisedUser
,
42 // Note: Order doesn't matter here, so keep this in alphabetic order, don't
43 // just add your stuff at the end!
47 bool MatchSystemNotifierId(const message_center::NotifierId
& notifier_id
,
48 const char* id_list
[]) {
49 if (notifier_id
.type
!= message_center::NotifierId::SYSTEM_COMPONENT
)
52 for (size_t i
= 0; id_list
[i
] != NULL
; ++i
) {
53 if (notifier_id
.id
== id_list
[i
])
61 const char kNotifierBluetooth
[] = "ash.bluetooth";
62 const char kNotifierDisplay
[] = "ash.display";
63 const char kNotifierDisplayError
[] = "ash.display.error";
64 const char kNotifierDisplayResolutionChange
[] = "ash.display.resolution-change";
65 const char kNotifierLocale
[] = "ash.locale";
66 const char kNotifierMultiProfileFirstRun
[] = "ash.multi-profile.first-run";
67 const char kNotifierNetwork
[] = "ash.network";
68 const char kNotifierNetworkError
[] = "ash.network.error";
69 const char kNotifierNetworkPortalDetector
[] = "ash.network.portal-detector";
70 const char kNotifierPower
[] = "ash.power";
71 const char kNotifierScreenshot
[] = "ash.screenshot";
72 const char kNotifierScreenCapture
[] = "ash.screen-capture";
73 const char kNotifierScreenShare
[] = "ash.screen-share";
74 const char kNotifierSessionLengthTimeout
[] = "ash.session-length-timeout";
75 const char kNotifierSupervisedUser
[] = "ash.locally-managed-user";
77 bool ShouldAlwaysShowPopups(const message_center::NotifierId
& notifier_id
) {
78 return MatchSystemNotifierId(notifier_id
, kAlwaysShownNotifierIds
);
81 bool IsAshSystemNotifier(const message_center::NotifierId
& notifier_id
) {
82 return MatchSystemNotifierId(notifier_id
, kAshSystemNotifiers
);
85 } // namespace system_notifier