Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Makes battery notifier as ash system notifier.
Browse files Browse the repository at this point in the history
battery notifier is listed in kAlwaysShownNotifierIds but not
in kAshSystemNotifiers, which causes a side effect of being
blocked by MultiUserNotificationBlockerChromeOS when logged in.

BUG=477722
[email protected], [email protected]
TEST=manually verified (see #25 of the bug for the repro steps)

Review URL: https://codereview.chromium.org/1098003002

Cr-Commit-Position: refs/heads/master@{#325966}
  • Loading branch information
jmuk authored and Commit bot committed Apr 21, 2015
1 parent e86ba5e commit 2358a2d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions ash/system/system_notifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ namespace {

// See http://dev.chromium.org/chromium-os/chromiumos-design-docs/
// system-notifications for the reasoning.
const char* kAlwaysShownNotifierIds[] = {

// |kAlwaysShownSystemNotifierIds| is the list of system notification sources
// which can appear regardless of the situation, such like login screen or lock
// screen.
const char* kAlwaysShownSystemNotifierIds[] = {
kNotifierBattery,
kNotifierDisplay,
kNotifierDisplayError,
Expand All @@ -29,19 +33,17 @@ const char* kAlwaysShownNotifierIds[] = {
// just add your stuff at the end!
NULL};

// |kAshSystemNotifiers| is the list of normal system notification sources for
// ash events. These notifications can be hidden in some context.
const char* kAshSystemNotifiers[] = {
kNotifierBluetooth,
kNotifierDisplay,
kNotifierDisplayError,
kNotifierDisplayResolutionChange,
kNotifierLocale,
kNotifierMultiProfileFirstRun,
#if defined(OS_CHROMEOS)
ui::NetworkStateNotifier::kNotifierNetwork,
ui::NetworkStateNotifier::kNotifierNetworkError,
#endif
kNotifierNetworkPortalDetector,
kNotifierPower,
kNotifierScreenshot,
kNotifierScreenCapture,
kNotifierScreenShare,
Expand Down Expand Up @@ -82,11 +84,12 @@ const char kNotifierSessionLengthTimeout[] = "ash.session-length-timeout";
const char kNotifierSupervisedUser[] = "ash.locally-managed-user";

bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) {
return MatchSystemNotifierId(notifier_id, kAlwaysShownNotifierIds);
return MatchSystemNotifierId(notifier_id, kAlwaysShownSystemNotifierIds);
}

bool IsAshSystemNotifier(const message_center::NotifierId& notifier_id) {
return MatchSystemNotifierId(notifier_id, kAshSystemNotifiers);
return ShouldAlwaysShowPopups(notifier_id) ||
MatchSystemNotifierId(notifier_id, kAshSystemNotifiers);
}

} // namespace system_notifier
Expand Down

0 comments on commit 2358a2d

Please sign in to comment.