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

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

Issue 1014753003: Move low battery notification to Message Center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/system/system_notifier.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #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"
11 #endif 11 #endif
12 12
13 namespace ash { 13 namespace ash {
14 namespace system_notifier { 14 namespace system_notifier {
15 15
16 namespace { 16 namespace {
17 17
18 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/ 18 // See http://dev.chromium.org/chromium-os/chromiumos-design-docs/
19 // system-notifications for the reasoning. 19 // system-notifications for the reasoning.
20 const char* kAlwaysShownNotifierIds[] = { 20 const char* kAlwaysShownNotifierIds[] = {
21 kNotifierDisplay, 21 kNotifierBattery,
22 kNotifierDisplayError, 22 kNotifierDisplay,
23 kNotifierDisplayError,
23 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
24 ui::NetworkStateNotifier::kNotifierNetworkError, 25 ui::NetworkStateNotifier::kNotifierNetworkError,
25 #endif 26 #endif
26 kNotifierPower, 27 kNotifierPower,
27 // Note: Order doesn't matter here, so keep this in alphabetic order, don't 28 // Note: Order doesn't matter here, so keep this in alphabetic order, don't
28 // just add your stuff at the end! 29 // just add your stuff at the end!
29 NULL 30 NULL};
30 };
31 31
32 const char* kAshSystemNotifiers[] = { 32 const char* kAshSystemNotifiers[] = {
33 kNotifierBluetooth, 33 kNotifierBluetooth,
34 kNotifierDisplay, 34 kNotifierDisplay,
35 kNotifierDisplayError, 35 kNotifierDisplayError,
36 kNotifierDisplayResolutionChange, 36 kNotifierDisplayResolutionChange,
37 kNotifierLocale, 37 kNotifierLocale,
38 kNotifierMultiProfileFirstRun, 38 kNotifierMultiProfileFirstRun,
39 #if defined(OS_CHROMEOS) 39 #if defined(OS_CHROMEOS)
40 ui::NetworkStateNotifier::kNotifierNetwork, 40 ui::NetworkStateNotifier::kNotifierNetwork,
(...skipping 18 matching lines...) Expand all
59 59
60 for (size_t i = 0; id_list[i] != NULL; ++i) { 60 for (size_t i = 0; id_list[i] != NULL; ++i) {
61 if (notifier_id.id == id_list[i]) 61 if (notifier_id.id == id_list[i])
62 return true; 62 return true;
63 } 63 }
64 return false; 64 return false;
65 } 65 }
66 66
67 } // namespace 67 } // namespace
68 68
69 const char kNotifierBattery[] = "ash.battery";
69 const char kNotifierBluetooth[] = "ash.bluetooth"; 70 const char kNotifierBluetooth[] = "ash.bluetooth";
70 const char kNotifierDisplay[] = "ash.display"; 71 const char kNotifierDisplay[] = "ash.display";
71 const char kNotifierDisplayError[] = "ash.display.error"; 72 const char kNotifierDisplayError[] = "ash.display.error";
72 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change"; 73 const char kNotifierDisplayResolutionChange[] = "ash.display.resolution-change";
73 const char kNotifierLocale[] = "ash.locale"; 74 const char kNotifierLocale[] = "ash.locale";
74 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run"; 75 const char kNotifierMultiProfileFirstRun[] = "ash.multi-profile.first-run";
75 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector"; 76 const char kNotifierNetworkPortalDetector[] = "ash.network.portal-detector";
76 const char kNotifierPower[] = "ash.power"; 77 const char kNotifierPower[] = "ash.power";
77 const char kNotifierScreenshot[] = "ash.screenshot"; 78 const char kNotifierScreenshot[] = "ash.screenshot";
78 const char kNotifierScreenCapture[] = "ash.screen-capture"; 79 const char kNotifierScreenCapture[] = "ash.screen-capture";
79 const char kNotifierScreenShare[] = "ash.screen-share"; 80 const char kNotifierScreenShare[] = "ash.screen-share";
80 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout"; 81 const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout";
81 const char kNotifierSupervisedUser[] = "ash.locally-managed-user"; 82 const char kNotifierSupervisedUser[] = "ash.locally-managed-user";
82 83
83 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) { 84 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) {
84 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds); 85 return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds);
85 } 86 }
86 87
87 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) { 88 bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) {
88 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers); 89 return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers);
89 } 90 }
90 91
91 } // namespace system_notifier 92 } // namespace system_notifier
92 } // namespace ash 93 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/system_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698