| 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/common/system/system_notifier.h" | 5 #include "ash/common/system/system_notifier.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace ash { | 9 namespace ash { |
| 10 namespace system_notifier { | 10 namespace system_notifier { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/ | 14 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/ |
| 15 // system-notifications for the reasoning. | 15 // system-notifications for the reasoning. |
| 16 | 16 |
| 17 // |kAlwaysShownSystemNotifierIds| is the list of system notification sources | 17 // |kAlwaysShownSystemNotifierIds| is the list of system notification sources |
| 18 // which can appear regardless of the situation, such like login screen or lock | 18 // which can appear regardless of the situation, such like login screen or lock |
| 19 // screen. | 19 // screen. |
| 20 const char* kAlwaysShownSystemNotifierIds[] = { | 20 const char* kAlwaysShownSystemNotifierIds[] = { |
| 21 kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery, | 21 kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery, |
| 22 kNotifierDisplay, kNotifierDisplayError, | 22 kNotifierDisplay, kNotifierDisplayError, |
| 23 #if defined(OS_CHROMEOS) | |
| 24 kNotifierNetworkError, | 23 kNotifierNetworkError, |
| 25 #endif | |
| 26 kNotifierPower, | 24 kNotifierPower, |
| 27 // Note: Order doesn't matter here, so keep this in alphabetic order, don't | 25 // Note: Order doesn't matter here, so keep this in alphabetic order, don't |
| 28 // just add your stuff at the end! | 26 // just add your stuff at the end! |
| 29 NULL}; | 27 NULL}; |
| 30 | 28 |
| 31 // |kAshSystemNotifiers| is the list of normal system notification sources for | 29 // |kAshSystemNotifiers| is the list of normal system notification sources for |
| 32 // ash events. These notifications can be hidden in some context. | 30 // ash events. These notifications can be hidden in some context. |
| 33 const char* kAshSystemNotifiers[] = { | 31 const char* kAshSystemNotifiers[] = { |
| 34 kNotifierBluetooth, kNotifierDisplayResolutionChange, | 32 kNotifierBluetooth, kNotifierDisplayResolutionChange, kNotifierDisk, |
| 35 #if defined(OS_CHROMEOS) | 33 kNotifierLocale, kNotifierMultiProfileFirstRun, kNotifierNetwork, |
| 36 kNotifierDisk, | |
| 37 #endif | |
| 38 kNotifierLocale, kNotifierMultiProfileFirstRun, | |
| 39 #if defined(OS_CHROMEOS) | |
| 40 kNotifierNetwork, | |
| 41 #endif | |
| 42 kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture, | 34 kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture, |
| 43 kNotifierScreenShare, kNotifierSessionLengthTimeout, | 35 kNotifierScreenShare, kNotifierSessionLengthTimeout, |
| 44 kNotifierSupervisedUser, kNotifierWebUsb, | 36 kNotifierSupervisedUser, kNotifierWebUsb, |
| 45 // Note: Order doesn't matter here, so keep this in alphabetic order, don't | 37 // Note: Order doesn't matter here, so keep this in alphabetic order, don't |
| 46 // just add your stuff at the end! | 38 // just add your stuff at the end! |
| 47 NULL}; | 39 NULL}; |
| 48 | 40 |
| 49 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id, | 41 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id, |
| 50 const char* id_list[]) { | 42 const char* id_list[]) { |
| 51 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT) | 43 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); | 80 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); |
| 89 } | 81 } |
| 90 | 82 |
| 91 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 83 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
| 92 return ShouldAlwaysShowPopups(notifier_id) || | 84 return ShouldAlwaysShowPopups(notifier_id) || |
| 93 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 85 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
| 94 } | 86 } |
| 95 | 87 |
| 96 } // namespace system_notifier | 88 } // namespace system_notifier |
| 97 } // namespace ash | 89 } // namespace ash |
| OLD | NEW |