| 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 #if defined(OS_CHROMEOS) | 9 #if defined(OS_CHROMEOS) |
| 10 #include "ui/chromeos/network/network_state_notifier.h" | 10 #include "ui/chromeos/network/network_state_notifier.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 kNotifierPower, | 32 kNotifierPower, |
| 33 // Note: Order doesn't matter here, so keep this in alphabetic order, don't | 33 // Note: Order doesn't matter here, so keep this in alphabetic order, don't |
| 34 // just add your stuff at the end! | 34 // just add your stuff at the end! |
| 35 NULL}; | 35 NULL}; |
| 36 | 36 |
| 37 // |kAshSystemNotifiers| is the list of normal system notification sources for | 37 // |kAshSystemNotifiers| is the list of normal system notification sources for |
| 38 // ash events. These notifications can be hidden in some context. | 38 // ash events. These notifications can be hidden in some context. |
| 39 const char* kAshSystemNotifiers[] = { | 39 const char* kAshSystemNotifiers[] = { |
| 40 kNotifierBluetooth, | 40 kNotifierBluetooth, |
| 41 kNotifierDisplayResolutionChange, | 41 kNotifierDisplayResolutionChange, |
| 42 #if defined(OS_CHROMEOS) |
| 43 kNotifierDisk, |
| 44 #endif |
| 42 kNotifierLocale, | 45 kNotifierLocale, |
| 43 kNotifierMultiProfileFirstRun, | 46 kNotifierMultiProfileFirstRun, |
| 44 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
| 45 ui::NetworkStateNotifier::kNotifierNetwork, | 48 ui::NetworkStateNotifier::kNotifierNetwork, |
| 46 #endif | 49 #endif |
| 47 kNotifierNetworkPortalDetector, | 50 kNotifierNetworkPortalDetector, |
| 48 kNotifierScreenshot, | 51 kNotifierScreenshot, |
| 49 kNotifierScreenCapture, | 52 kNotifierScreenCapture, |
| 50 kNotifierScreenShare, | 53 kNotifierScreenShare, |
| 51 kNotifierSessionLengthTimeout, | 54 kNotifierSessionLengthTimeout, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 66 return true; | 69 return true; |
| 67 } | 70 } |
| 68 return false; | 71 return false; |
| 69 } | 72 } |
| 70 | 73 |
| 71 } // namespace | 74 } // namespace |
| 72 | 75 |
| 73 const char kNotifierBattery[] = "ash.battery"; | 76 const char kNotifierBattery[] = "ash.battery"; |
| 74 const char kNotifierBluetooth[] = "ash.bluetooth"; | 77 const char kNotifierBluetooth[] = "ash.bluetooth"; |
| 75 const char kNotifierDeprecatedAccelerator[] = "ash.accelerator-controller"; | 78 const char kNotifierDeprecatedAccelerator[] = "ash.accelerator-controller"; |
| 79 const char kNotifierDisk[] = "ash.disk"; |
| 76 const char kNotifierDisplay[] = "ash.display"; | 80 const char kNotifierDisplay[] = "ash.display"; |
| 77 const char kNotifierDisplayError[] = "ash.display.error"; | 81 const char kNotifierDisplayError[] = "ash.display.error"; |
| 78 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; | 82 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; |
| 79 const char kNotifierDualRole[] = "ash.dual-role"; | 83 const char kNotifierDualRole[] = "ash.dual-role"; |
| 80 const char kNotifierHats[] = "ash.hats"; | 84 const char kNotifierHats[] = "ash.hats"; |
| 81 const char kNotifierLocale[] = "ash.locale"; | 85 const char kNotifierLocale[] = "ash.locale"; |
| 82 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; | 86 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; |
| 83 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; | 87 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; |
| 84 const char kNotifierPower[] = "ash.power"; | 88 const char kNotifierPower[] = "ash.power"; |
| 85 const char kNotifierScreenshot[] = "ash.screenshot"; | 89 const char kNotifierScreenshot[] = "ash.screenshot"; |
| 86 const char kNotifierScreenCapture[] = "ash.screen-capture"; | 90 const char kNotifierScreenCapture[] = "ash.screen-capture"; |
| 87 const char kNotifierScreenShare[] = "ash.screen-share"; | 91 const char kNotifierScreenShare[] = "ash.screen-share"; |
| 88 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; | 92 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; |
| 89 const char kNotifierSupervisedUser[] = "ash.locally-managed-user"; | 93 const char kNotifierSupervisedUser[] = "ash.locally-managed-user"; |
| 90 const char kNotifierWebUsb[] = "ash.webusb"; | 94 const char kNotifierWebUsb[] = "ash.webusb"; |
| 91 | 95 |
| 92 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { | 96 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { |
| 93 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); | 97 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds); |
| 94 } | 98 } |
| 95 | 99 |
| 96 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 100 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
| 97 return ShouldAlwaysShowPopups(notifier_id) || | 101 return ShouldAlwaysShowPopups(notifier_id) || |
| 98 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 102 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
| 99 } | 103 } |
| 100 | 104 |
| 101 } // namespace system_notifier | 105 } // namespace system_notifier |
| 102 } // namespace ash | 106 } // namespace ash |
| OLD | NEW |