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