OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 "ash/system/system_notifier.h" | 5 #include "ash/system/system_notifier.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 #if defined(OS_CHROMEOS) | |
10 #include "ui/chromeos/network/network_state_notifier.h" | |
11 #endif | |
12 | |
13 namespace ash { | 9 namespace ash { |
14 namespace system_notifier { | 10 namespace system_notifier { |
15 | 11 |
16 namespace { | 12 namespace { |
17 | 13 |
18 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/ | 14 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/ |
19 // system-notifications for the reasoning. | 15 // system-notifications for the reasoning. |
20 const char* kAlwaysShownNotifierIds[] = { | 16 const char* kAlwaysShownNotifierIds[] = { |
21 kNotifierDisplay, | 17 kNotifierDisplay, |
22 kNotifierDisplayError, | 18 kNotifierDisplayError, |
23 #if defined(OS_CHROMEOS) | 19 kNotifierNetworkError, |
24 ui::NetworkStateNotifier::kNotifierNetworkError, | |
25 #endif | |
26 kNotifierPower, | 20 kNotifierPower, |
27 // Note: Order doesn't matter here, so keep this in alphabetic order, don't | 21 // Note: Order doesn't matter here, so keep this in alphabetic order, don't |
28 // just add your stuff at the end! | 22 // just add your stuff at the end! |
29 NULL | 23 NULL |
30 }; | 24 }; |
31 | 25 |
32 const char* kAshSystemNotifiers[] = { | 26 const char* kAshSystemNotifiers[] = { |
33 kNotifierBluetooth, | 27 kNotifierBluetooth, |
34 kNotifierDisplay, | 28 kNotifierDisplay, |
35 kNotifierDisplayError, | 29 kNotifierDisplayError, |
36 kNotifierDisplayResolutionChange, | 30 kNotifierDisplayResolutionChange, |
37 kNotifierLocale, | 31 kNotifierLocale, |
38 kNotifierMultiProfileFirstRun, | 32 kNotifierMultiProfileFirstRun, |
39 #if defined(OS_CHROMEOS) | 33 kNotifierNetwork, |
40 ui::NetworkStateNotifier::kNotifierNetwork, | 34 kNotifierNetworkError, |
41 ui::NetworkStateNotifier::kNotifierNetworkError, | |
42 #endif | |
43 kNotifierNetworkPortalDetector, | 35 kNotifierNetworkPortalDetector, |
44 kNotifierPower, | 36 kNotifierPower, |
45 kNotifierScreenshot, | 37 kNotifierScreenshot, |
46 kNotifierScreenCapture, | 38 kNotifierScreenCapture, |
47 kNotifierScreenShare, | 39 kNotifierScreenShare, |
48 kNotifierSessionLengthTimeout, | 40 kNotifierSessionLengthTimeout, |
49 kNotifierSupervisedUser, | 41 kNotifierSupervisedUser, |
50 // Note: Order doesn't matter here, so keep this in alphabetic order, don't | 42 // Note: Order doesn't matter here, so keep this in alphabetic order, don't |
51 // just add your stuff at the end! | 43 // just add your stuff at the end! |
52 NULL | 44 NULL |
(...skipping 12 matching lines...) Expand all Loading... |
65 } | 57 } |
66 | 58 |
67 } // namespace | 59 } // namespace |
68 | 60 |
69 const char kNotifierBluetooth[] = "ash.bluetooth"; | 61 const char kNotifierBluetooth[] = "ash.bluetooth"; |
70 const char kNotifierDisplay[] = "ash.display"; | 62 const char kNotifierDisplay[] = "ash.display"; |
71 const char kNotifierDisplayError[] = "ash.display.error"; | 63 const char kNotifierDisplayError[] = "ash.display.error"; |
72 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; | 64 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; |
73 const char kNotifierLocale[] = "ash.locale"; | 65 const char kNotifierLocale[] = "ash.locale"; |
74 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; | 66 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; |
| 67 const char kNotifierNetwork[] = "ash.network"; |
| 68 const char kNotifierNetworkError[] = "ash.network.error"; |
75 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; | 69 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; |
76 const char kNotifierPower[] = "ash.power"; | 70 const char kNotifierPower[] = "ash.power"; |
77 const char kNotifierScreenshot[] = "ash.screenshot"; | 71 const char kNotifierScreenshot[] = "ash.screenshot"; |
78 const char kNotifierScreenCapture[] = "ash.screen-capture"; | 72 const char kNotifierScreenCapture[] = "ash.screen-capture"; |
79 const char kNotifierScreenShare[] = "ash.screen-share"; | 73 const char kNotifierScreenShare[] = "ash.screen-share"; |
80 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; | 74 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; |
81 const char kNotifierSupervisedUser[] = "ash.locally-managed-user"; | 75 const char kNotifierSupervisedUser[] = "ash.locally-managed-user"; |
82 | 76 |
83 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { | 77 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { |
84 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds); | 78 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds); |
85 } | 79 } |
86 | 80 |
87 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 81 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
88 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 82 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
89 } | 83 } |
90 | 84 |
91 } // namespace system_notifier | 85 } // namespace system_notifier |
92 } // namespace ash | 86 } // namespace ash |
OLD | NEW |