| 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 kNotifierDeprecatedAccelerator, kNotifierBattery, kNotifierDisplay, | 21 kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery, |
| 22 kNotifierDisplayError, | 22 kNotifierDisplay, kNotifierDisplayError, |
| 23 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
| 24 kNotifierNetworkError, | 24 kNotifierNetworkError, |
| 25 #endif | 25 #endif |
| 26 kNotifierPower, | 26 kNotifierPower, |
| 27 // 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 |
| 28 // just add your stuff at the end! | 28 // just add your stuff at the end! |
| 29 NULL}; | 29 NULL}; |
| 30 | 30 |
| 31 // |kAshSystemNotifiers| is the list of normal system notification sources for | 31 // |kAshSystemNotifiers| is the list of normal system notification sources for |
| 32 // ash events. These notifications can be hidden in some context. | 32 // ash events. These notifications can be hidden in some context. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 | 53 |
| 54 for (size_t i = 0; id_list[i] != NULL; ++i) { | 54 for (size_t i = 0; id_list[i] != NULL; ++i) { |
| 55 if (notifier_id.id == id_list[i]) | 55 if (notifier_id.id == id_list[i]) |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace | 61 } // namespace |
| 62 | 62 |
| 63 const char kNotifierAccessibility[] = "ash.accessibility"; |
| 63 const char kNotifierBattery[] = "ash.battery"; | 64 const char kNotifierBattery[] = "ash.battery"; |
| 64 const char kNotifierBluetooth[] = "ash.bluetooth"; | 65 const char kNotifierBluetooth[] = "ash.bluetooth"; |
| 65 const char kNotifierDeprecatedAccelerator[] = "ash.accelerator-controller"; | 66 const char kNotifierDeprecatedAccelerator[] = "ash.accelerator-controller"; |
| 66 const char kNotifierDisk[] = "ash.disk"; | 67 const char kNotifierDisk[] = "ash.disk"; |
| 67 const char kNotifierDisplay[] = "ash.display"; | 68 const char kNotifierDisplay[] = "ash.display"; |
| 68 const char kNotifierDisplayError[] = "ash.display.error"; | 69 const char kNotifierDisplayError[] = "ash.display.error"; |
| 69 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; | 70 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; |
| 70 const char kNotifierDualRole[] = "ash.dual-role"; | 71 const char kNotifierDualRole[] = "ash.dual-role"; |
| 71 const char kNotifierHats[] = "ash.hats"; | 72 const char kNotifierHats[] = "ash.hats"; |
| 72 const char kNotifierLocale[] = "ash.locale"; | 73 const char kNotifierLocale[] = "ash.locale"; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 87 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); | 88 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); |
| 88 } | 89 } |
| 89 | 90 |
| 90 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 91 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
| 91 return ShouldAlwaysShowPopups(notifier_id) || | 92 return ShouldAlwaysShowPopups(notifier_id) || |
| 92 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 93 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
| 93 } | 94 } |
| 94 | 95 |
| 95 } // namespace system_notifier | 96 } // namespace system_notifier |
| 96 } // namespace ash | 97 } // namespace ash |
| OLD | NEW |