| 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 { |
| 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 const char* kAlwaysShownNotifierIds[] = { | 16 const char* kAlwaysShownNotifierIds[] = { |
| 17 kNotifierDisplay, | 17 kNotifierDisplay, |
| 18 kNotifierDisplayError, | 18 kNotifierDisplayError, |
| 19 kNotifierPower, | 19 kNotifierPower, |
| 20 NULL | 20 NULL |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 const char* kAshSystemNotifiers[] = { | 23 const char* kAshSystemNotifiers[] = { |
| 24 kNotifierDisplay, | 24 kNotifierDisplay, |
| 25 kNotifierDisplayResolutionChange, | 25 kNotifierDisplayResolutionChange, |
| 26 kNotifierDisplayError, | 26 kNotifierDisplayError, |
| 27 kNotifierInputMethod, | |
| 28 kNotifierLocale, | 27 kNotifierLocale, |
| 29 kNotifierLocallyManagedUser, | 28 kNotifierLocallyManagedUser, |
| 30 kNotifierMultiProfileFirstRun, | 29 kNotifierMultiProfileFirstRun, |
| 31 kNotifierNetwork, | 30 kNotifierNetwork, |
| 32 kNotifierNetworkError, | 31 kNotifierNetworkError, |
| 33 kNotifierScreenshot, | 32 kNotifierScreenshot, |
| 34 kNotifierScreenCapture, | 33 kNotifierScreenCapture, |
| 35 kNotifierScreenShare, | 34 kNotifierScreenShare, |
| 36 kNotifierSessionLengthTimeout, | 35 kNotifierSessionLengthTimeout, |
| 37 kNotifierPower, | 36 kNotifierPower, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 48 return true; | 47 return true; |
| 49 } | 48 } |
| 50 return false; | 49 return false; |
| 51 } | 50 } |
| 52 | 51 |
| 53 } // namespace | 52 } // namespace |
| 54 | 53 |
| 55 const char kNotifierDisplay[] = "ash.display"; | 54 const char kNotifierDisplay[] = "ash.display"; |
| 56 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; | 55 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; |
| 57 const char kNotifierDisplayError[] = "ash.display.error"; | 56 const char kNotifierDisplayError[] = "ash.display.error"; |
| 58 const char kNotifierInputMethod[] = "ash.input-method"; | |
| 59 const char kNotifierLocale[] = "ash.locale"; | 57 const char kNotifierLocale[] = "ash.locale"; |
| 60 const char kNotifierLocallyManagedUser[] = "ash.locally-managed-user"; | 58 const char kNotifierLocallyManagedUser[] = "ash.locally-managed-user"; |
| 61 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; | 59 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; |
| 62 const char kNotifierNetwork[] = "ash.network"; | 60 const char kNotifierNetwork[] = "ash.network"; |
| 63 const char kNotifierNetworkError[] = "ash.network.error"; | 61 const char kNotifierNetworkError[] = "ash.network.error"; |
| 64 const char kNotifierScreenshot[] = "ash.screenshot"; | 62 const char kNotifierScreenshot[] = "ash.screenshot"; |
| 65 const char kNotifierScreenCapture[] = "ash.screen-capture"; | 63 const char kNotifierScreenCapture[] = "ash.screen-capture"; |
| 66 const char kNotifierScreenShare[] = "ash.screen-share"; | 64 const char kNotifierScreenShare[] = "ash.screen-share"; |
| 67 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; | 65 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; |
| 68 const char kNotifierPower[] = "ash.power"; | 66 const char kNotifierPower[] = "ash.power"; |
| 69 | 67 |
| 70 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { | 68 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { |
| 71 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds); | 69 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds); |
| 72 } | 70 } |
| 73 | 71 |
| 74 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 72 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
| 75 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 73 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
| 76 } | 74 } |
| 77 | 75 |
| 78 } // namespace system_notifier | 76 } // namespace system_notifier |
| 79 } // namespace ash | 77 } // namespace ash |
| OLD | NEW |