- add sources.
[platform/framework/web/crosswalk.git] / src / ash / system / system_notifier.cc
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/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 const AshSystemComponentNotifierType kAlwaysShownNotifierIds[] = {
17   NOTIFIER_DISPLAY,
18   NOTIFIER_DISPLAY_ERROR,
19   NOTIFIER_POWER,
20 };
21
22 }  // namespace
23
24 std::string SystemComponentTypeToString(AshSystemComponentNotifierType type) {
25   if (type == NOTIFIER_SCREENSHOT)
26     return "screenshot";
27
28   // TODO(mukai): fill the names of other components.
29   NOTIMPLEMENTED();
30   return std::string();
31 }
32
33 bool ShouldAlwaysShowPopups(const message_center::NotifierId& notifier_id) {
34   if (notifier_id.type != message_center::NotifierId::SYSTEM_COMPONENT)
35     return false;
36
37   for (size_t i = 0; i < arraysize(kAlwaysShownNotifierIds); ++i) {
38     if (notifier_id.system_component_type == kAlwaysShownNotifierIds[i])
39       return true;
40   }
41   return false;
42 }
43
44 }  // namespace system_notifier
45 }  // namespace ash