Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(637)

Side by Side Diff: ash/common/system/system_notifier.cc

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/system/system_notifier.h ('k') | ash/common/system/tiles/tiles_default_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/common/system/system_notifier.h"
6
7 #include "base/logging.h"
8
9 namespace ash {
10 namespace system_notifier {
11
12 namespace {
13
14 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/
15 // system-notifications for the reasoning.
16
17 // |kAlwaysShownSystemNotifierIds| is the list of system notification sources
18 // which can appear regardless of the situation, such like login screen or lock
19 // screen.
20 const char* kAlwaysShownSystemNotifierIds[] = {
21 kNotifierAccessibility, kNotifierDeprecatedAccelerator, kNotifierBattery,
22 kNotifierDisplay, kNotifierDisplayError, kNotifierNetworkError,
23 kNotifierPower,
24 // Note: Order doesn't matter here, so keep this in alphabetic order, don't
25 // just add your stuff at the end!
26 NULL};
27
28 // |kAshSystemNotifiers| is the list of normal system notification sources for
29 // ash events. These notifications can be hidden in some context.
30 const char* kAshSystemNotifiers[] = {
31 kNotifierBluetooth, kNotifierDisplayResolutionChange, kNotifierDisk,
32 kNotifierLocale, kNotifierMultiProfileFirstRun, kNotifierNetwork,
33 kNotifierNetworkPortalDetector, kNotifierScreenshot, kNotifierScreenCapture,
34 kNotifierScreenShare, kNotifierSessionLengthTimeout,
35 kNotifierSupervisedUser, kNotifierWebUsb, kNotifierSms,
36 // Note: Order doesn't matter here, so keep this in alphabetic order, don't
37 // just add your stuff at the end!
38 NULL};
39
40 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id,
41 const char* id_list[]) {
42 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT)
43 return false;
44
45 for (size_t i = 0; id_list[i] != NULL; ++i) {
46 if (notifier_id.id == id_list[i])
47 return true;
48 }
49 return false;
50 }
51
52 } // namespace
53
54 const char kNotifierAccessibility[] = "ash.accessibility";
55 const char kNotifierBattery[] = "ash.battery";
56 const char kNotifierBluetooth[] = "ash.bluetooth";
57 const char kNotifierDeprecatedAccelerator[] = "ash.accelerator-controller";
58 const char kNotifierDisk[] = "ash.disk";
59 const char kNotifierDisplay[] = "ash.display";
60 const char kNotifierDisplayError[] = "ash.display.error";
61 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change";
62 const char kNotifierDualRole[] = "ash.dual-role";
63 const char kNotifierHats[] = "ash.hats";
64 const char kNotifierLocale[] = "ash.locale";
65 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run";
66 const char kNotifierNetwork[] = "ash.network";
67 const char kNotifierNetworkError[] = "ash.network.error";
68 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector";
69 const char kNotifierPower[] = "ash.power";
70 const char kNotifierQuickUnlock[] = "ash.quickunlock";
71 const char kNotifierScreenshot[] = "ash.screenshot";
72 const char kNotifierScreenCapture[] = "ash.screen-capture";
73 const char kNotifierScreenShare[] = "ash.screen-share";
74 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout";
75 const char kNotifierSms[] = "ash.sms";
76 const char kNotifierSupervisedUser[] = "ash.locally-managed-user";
77 const char kNotifierWebUsb[] = "ash.webusb";
78
79 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) {
80 return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds);
81 }
82
83 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) {
84 return ShouldAlwaysShowPopups(notifier_id) ||
85 MatchSystemNotifierId(notifier_id, kAshSystemNotifiers);
86 }
87
88 } // namespace system_notifier
89 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/system_notifier.h ('k') | ash/common/system/tiles/tiles_default_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698