Chromium Code Reviews| 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, kNotifierNetworkError, |
| 23 kNotifierNetworkError, | |
| 24 kNotifierPower, | 23 kNotifierPower, |
| 24 #if defined(OS_CHROMEOS) | |
| 25 kNotifierSms, | |
|
tdanderson
2017/01/26 22:19:07
Why does this need to be ifdefed for CrOS?
yiyix
2017/02/02 20:43:56
No sms will be received for no-CrOS? This block of
tdanderson
2017/02/07 00:15:45
Thanks, the way you have it in Patch set 2 looks g
| |
| 26 #endif | |
| 25 // 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 |
| 26 // just add your stuff at the end! | 28 // just add your stuff at the end! |
| 27 NULL}; | 29 NULL}; |
| 28 | 30 |
| 29 // |kAshSystemNotifiers| is the list of normal system notification sources for | 31 // |kAshSystemNotifiers| is the list of normal system notification sources for |
| 30 // ash events. These notifications can be hidden in some context. | 32 // ash events. These notifications can be hidden in some context. |
| 31 const char* kAshSystemNotifiers[] = { | 33 const char* kAshSystemNotifiers[] = { |
| 32 kNotifierBluetooth, kNotifierDisplayResolutionChange, kNotifierDisk, | 34 kNotifierBluetooth, kNotifierDisplayResolutionChange, kNotifierDisk, |
| 33 kNotifierLocale, kNotifierMultiProfileFirstRun, kNotifierNetwork, | 35 kNotifierLocale, kNotifierMultiProfileFirstRun, kNotifierNetwork, |
| 34 kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture, | 36 kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; | 68 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; |
| 67 const char kNotifierNetwork[] = "ash.network"; | 69 const char kNotifierNetwork[] = "ash.network"; |
| 68 const char kNotifierNetworkError[] = "ash.network.error"; | 70 const char kNotifierNetworkError[] = "ash.network.error"; |
| 69 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; | 71 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; |
| 70 const char kNotifierPower[] = "ash.power"; | 72 const char kNotifierPower[] = "ash.power"; |
| 71 const char kNotifierQuickUnlock[] = "ash.quickunlock"; | 73 const char kNotifierQuickUnlock[] = "ash.quickunlock"; |
| 72 const char kNotifierScreenshot[] = "ash.screenshot"; | 74 const char kNotifierScreenshot[] = "ash.screenshot"; |
| 73 const char kNotifierScreenCapture[] = "ash.screen-capture"; | 75 const char kNotifierScreenCapture[] = "ash.screen-capture"; |
| 74 const char kNotifierScreenShare[] = "ash.screen-share"; | 76 const char kNotifierScreenShare[] = "ash.screen-share"; |
| 75 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; | 77 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; |
| 78 const char kNotifierSms[] = "ash.sms"; | |
| 76 const char kNotifierSupervisedUser[] = "ash.locally-managed-user"; | 79 const char kNotifierSupervisedUser[] = "ash.locally-managed-user"; |
| 77 const char kNotifierWebUsb[] = "ash.webusb"; | 80 const char kNotifierWebUsb[] = "ash.webusb"; |
| 78 | 81 |
| 79 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { | 82 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { |
| 80 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); | 83 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); |
| 81 } | 84 } |
| 82 | 85 |
| 83 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 86 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
| 84 return ShouldAlwaysShowPopups(notifier_id) || | 87 return ShouldAlwaysShowPopups(notifier_id) || |
| 85 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 88 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
| 86 } | 89 } |
| 87 | 90 |
| 88 } // namespace system_notifier | 91 } // namespace system_notifier |
| 89 } // namespace ash | 92 } // namespace ash |
| OLD | NEW |