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 17 matching lines...) Expand all Loading... |
28 kNotifierLocallyManagedUser, | 28 kNotifierLocallyManagedUser, |
29 kNotifierMultiProfileFirstRun, | 29 kNotifierMultiProfileFirstRun, |
30 kNotifierNetwork, | 30 kNotifierNetwork, |
31 kNotifierNetworkError, | 31 kNotifierNetworkError, |
32 kNotifierNetworkPortalDetector, | 32 kNotifierNetworkPortalDetector, |
33 kNotifierScreenshot, | 33 kNotifierScreenshot, |
34 kNotifierScreenCapture, | 34 kNotifierScreenCapture, |
35 kNotifierScreenShare, | 35 kNotifierScreenShare, |
36 kNotifierSessionLengthTimeout, | 36 kNotifierSessionLengthTimeout, |
37 kNotifierPower, | 37 kNotifierPower, |
| 38 kNotifierBluetooth, |
38 NULL | 39 NULL |
39 }; | 40 }; |
40 | 41 |
41 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id, | 42 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id, |
42 const char* id_list[]) { | 43 const char* id_list[]) { |
43 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT) | 44 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT) |
44 return false; | 45 return false; |
45 | 46 |
46 for (size_t i = 0; id_list[i] != NULL; ++i) { | 47 for (size_t i = 0; id_list[i] != NULL; ++i) { |
47 if (notifier_id.id == id_list[i]) | 48 if (notifier_id.id == id_list[i]) |
(...skipping 11 matching lines...) Expand all Loading... |
59 const char kNotifierLocallyManagedUser[] = "ash.locally-managed-user"; | 60 const char kNotifierLocallyManagedUser[] = "ash.locally-managed-user"; |
60 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; | 61 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; |
61 const char kNotifierNetwork[] = "ash.network"; | 62 const char kNotifierNetwork[] = "ash.network"; |
62 const char kNotifierNetworkError[] = "ash.network.error"; | 63 const char kNotifierNetworkError[] = "ash.network.error"; |
63 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; | 64 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; |
64 const char kNotifierScreenshot[] = "ash.screenshot"; | 65 const char kNotifierScreenshot[] = "ash.screenshot"; |
65 const char kNotifierScreenCapture[] = "ash.screen-capture"; | 66 const char kNotifierScreenCapture[] = "ash.screen-capture"; |
66 const char kNotifierScreenShare[] = "ash.screen-share"; | 67 const char kNotifierScreenShare[] = "ash.screen-share"; |
67 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; | 68 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; |
68 const char kNotifierPower[] = "ash.power"; | 69 const char kNotifierPower[] = "ash.power"; |
| 70 const char kNotifierBluetooth[] = "ash.bluetooth"; |
69 | 71 |
70 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { | 72 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { |
71 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds); | 73 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds); |
72 } | 74 } |
73 | 75 |
74 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { | 76 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { |
75 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); | 77 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); |
76 } | 78 } |
77 | 79 |
78 } // namespace system_notifier | 80 } // namespace system_notifier |
79 } // namespace ash | 81 } // namespace ash |
OLD | NEW |