| 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 namespace ash { | 9 namespace ash { |
| 10 namespace system_notifier { | 10 namespace system_notifier { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery, | 21 kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery, |
| 22 kNotifierDisplay, kNotifierDisplayError, kNotifierNetworkError, | 22 kNotifierDisplay, kNotifierDisplayError, kNotifierNetworkError, |
| 23 kNotifierPower, | 23 kNotifierPower, |
| 24 // Note: Order doesn't matter here, so keep this in alphabetic order, don't | 24 // Note: Order doesn't matter here, so keep this in alphabetic order, don't |
| 25 // just add your stuff at the end! | 25 // just add your stuff at the end! |
| 26 NULL}; | 26 NULL}; |
| 27 | 27 |
| 28 // |kAshSystemNotifiers| is the list of normal system notification sources for | 28 // |kAshSystemNotifiers| is the list of normal system notification sources for |
| 29 // ash events. These notifications can be hidden in some context. | 29 // ash events. These notifications can be hidden in some context. |
| 30 const char* kAshSystemNotifiers[] = { | 30 const char* kAshSystemNotifiers[] = { |
| 31 kNotifierBluetooth, kNotifierDisplayResolutionChange, kNotifierDisk, | 31 kNotifierBluetooth, kNotifierCapsLock, kNotifierDisplayResolutionChange, |
| 32 kNotifierLocale, kNotifierMultiProfileFirstRun, kNotifierNetwork, | 32 kNotifierDisk, kNotifierLocale, kNotifierMultiProfileFirstRun, |
| 33 kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture, | 33 kNotifierNetwork, kNotifierNetworkPortalDetector, kNotifierScreenshot, |
| 34 kNotifierScreenShare, kNotifierSessionLengthTimeout, | 34 kNotifierScreenCapture, kNotifierScreenShare, kNotifierSessionLengthTimeout, |
| 35 kNotifierSupervisedUser, kNotifierWebUsb, kNotifierSms, | 35 kNotifierSupervisedUser, kNotifierWebUsb, kNotifierSms, |
| 36 // Note: Order doesn't matter here, so keep this in alphabetic order, don't | 36 // Note: Order doesn't matter here, so keep this in alphabetic order, don't |
| 37 // just add your stuff at the end! | 37 // just add your stuff at the end! |
| 38 NULL}; | 38 NULL}; |
| 39 | 39 |
| 40 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id, | 40 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id, |
| 41 const char* id_list[]) { | 41 const char* id_list[]) { |
| 42 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT) | 42 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT) |
| 43 return false; | 43 return false; |
| 44 | 44 |
| 45 for (size_t i = 0; id_list[i] != NULL; ++i) { | 45 for (size_t i = 0; id_list[i] != NULL; ++i) { |
| 46 if (notifier_id.id == id_list[i]) | 46 if (notifier_id.id == id_list[i]) |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 return false; | 49 return false; |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 const char kNotifierAccessibility[] = "ash.accessibility"; | 54 const char kNotifierAccessibility[] = "ash.accessibility"; |
| 55 const char kNotifierBattery[] = "ash.battery"; | 55 const char kNotifierBattery[] = "ash.battery"; |
| 56 const char kNotifierBluetooth[] = "ash.bluetooth"; | 56 const char kNotifierBluetooth[] = "ash.bluetooth"; |
| 57 const char kNotifierCapsLock[] = "ash.caps-lock"; |
| 57 const char kNotifierDeprecatedAccelerator[] = "ash.accelerator-controller"; | 58 const char kNotifierDeprecatedAccelerator[] = "ash.accelerator-controller"; |
| 58 const char kNotifierDisk[] = "ash.disk"; | 59 const char kNotifierDisk[] = "ash.disk"; |
| 59 const char kNotifierDisplay[] = "ash.display"; | 60 const char kNotifierDisplay[] = "ash.display"; |
| 60 const char kNotifierDisplayError[] = "ash.display.error"; | 61 const char kNotifierDisplayError[] = "ash.display.error"; |
| 61 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; | 62 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; |
| 62 const char kNotifierDualRole[] = "ash.dual-role"; | 63 const char kNotifierDualRole[] = "ash.dual-role"; |
| 63 const char kNotifierFingerprintUnlock[] = "ash.fingerprintunlock"; | 64 const char kNotifierFingerprintUnlock[] = "ash.fingerprintunlock"; |
| 64 const char kNotifierHats[] = "ash.hats"; | 65 const char kNotifierHats[] = "ash.hats"; |
| 65 const char kNotifierLocale[] = "ash.locale"; | 66 const char kNotifierLocale[] = "ash.locale"; |
| 66 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; | 67 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 81 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); | 82 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); |
| 82 } | 83 } |
| 83 | 84 |
| 84 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 85 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
| 85 return ShouldAlwaysShowPopups(notifier_id) || | 86 return ShouldAlwaysShowPopups(notifier_id) || |
| 86 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 87 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
| 87 } | 88 } |
| 88 | 89 |
| 89 } // namespace system_notifier | 90 } // namespace system_notifier |
| 90 } // namespace ash | 91 } // namespace ash |
| OLD | NEW |