Disable TabDragController tests that fail with a real compositor.
[chromium-blink-merge.git] / ash / system / system_notifier.cc
blobe4d65d27338fcfac3be006d1f8707f3968cc5387
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.
5 #include "ash/system/system_notifier.h"
7 #include "base/logging.h"
9 namespace ash {
10 namespace system_notifier {
12 namespace {
14 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/
15 // system-notifications for the reasoning.
16 const char* kAlwaysShownNotifierIds[] = {
17 kNotifierDisplay,
18 kNotifierDisplayError,
19 kNotifierPower,
20 NULL
23 const char* kAshSystemNotifiers[] = {
24 kNotifierDisplay,
25 kNotifierDisplayResolutionChange,
26 kNotifierDisplayError,
27 kNotifierInputMethod,
28 kNotifierLocale,
29 kNotifierLocallyManagedUser,
30 kNotifierMultiProfileFirstRun,
31 kNotifierNetwork,
32 kNotifierNetworkError,
33 kNotifierScreenshot,
34 kNotifierScreenCapture,
35 kNotifierScreenShare,
36 kNotifierSessionLengthTimeout,
37 kNotifierPower,
38 NULL
41 bool MatchSystemNotifierId(const message_center::NotifierId& notifier_id,
42 const char* id_list[]) {
43 if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT)
44 return false;
46 for (size_t i = 0; id_list[i] != NULL; ++i) {
47 if (notifier_id.id == id_list[i])
48 return true;
50 return false;
53 } // namespace
55 const char kNotifierDisplay[] = "ash.display";
56 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change";
57 const char kNotifierDisplayError[] = "ash.display.error";
58 const char kNotifierInputMethod[] = "ash.input-method";
59 const char kNotifierLocale[] = "ash.locale";
60 const char kNotifierLocallyManagedUser[] = "ash.locally-managed-user";
61 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run";
62 const char kNotifierNetwork[] = "ash.network";
63 const char kNotifierNetworkError[] = "ash.network.error";
64 const char kNotifierScreenshot[] = "ash.screenshot";
65 const char kNotifierScreenCapture[] = "ash.screen-capture";
66 const char kNotifierScreenShare[] = "ash.screen-share";
67 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout";
68 const char kNotifierPower[] = "ash.power";
70 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) {
71 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds);
74 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) {
75 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers);
78 } // namespace system_notifier
79 } // namespace ash