1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_MODE_IDLE_APP_NAME_NOTIFICATION_H_
6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_MODE_IDLE_APP_NAME_NOTIFICATION_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/timer/timer.h"
12 #include "chromeos/dbus/power_manager_client.h"
13 #include "ui/wm/core/user_activity_observer.h"
16 class IdleAppNameNotificationView;
18 class KioskModeIdleAppNameNotification : public wm::UserActivityObserver,
19 public PowerManagerClient::Observer {
21 static void Initialize();
23 static void Shutdown();
25 KioskModeIdleAppNameNotification();
26 virtual ~KioskModeIdleAppNameNotification();
29 // Initialize idle app message when KioskModeHelper is initialized.
32 // wm::UserActivityObserver overrides:
33 virtual void OnUserActivity(const ui::Event* event) override;
35 // PowerManagerClient::Observer overrides:
36 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override;
38 // Begins listening for user activity and calls ResetTimer().
41 // Resets |timer_| to fire when the application idle message should be shown.
44 // Invoked by |timer_| to display the application idle message.
47 base::OneShotTimer<KioskModeIdleAppNameNotification> timer_;
49 // If set the notification should get shown upon next user activity.
50 bool show_notification_upon_next_user_activity_;
52 // The notification object which owns and shows the notification.
53 scoped_ptr<IdleAppNameNotificationView> notification_;
55 DISALLOW_COPY_AND_ASSIGN(KioskModeIdleAppNameNotification);
58 } // namespace chromeos
60 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_MODE_IDLE_APP_NAME_NOTIFICATION_H_