ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / chromeos / app_mode / kiosk_mode_idle_app_name_notification.h
blob0b844dc2ee7651dc3a5319ee90033f1292703af1
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/base/user_activity/user_activity_observer.h"
15 namespace chromeos {
17 class IdleAppNameNotificationView;
19 class KioskModeIdleAppNameNotification : public ui::UserActivityObserver,
20 public PowerManagerClient::Observer {
21 public:
22 static void Initialize();
24 static void Shutdown();
26 KioskModeIdleAppNameNotification();
27 ~KioskModeIdleAppNameNotification() override;
29 private:
30 // Initialize idle app message when KioskModeHelper is initialized.
31 void Setup();
33 // ui::UserActivityObserver overrides:
34 void OnUserActivity(const ui::Event* event) override;
36 // PowerManagerClient::Observer overrides:
37 void SuspendDone(const base::TimeDelta& sleep_duration) override;
39 // Begins listening for user activity and calls ResetTimer().
40 void Start();
42 // Resets |timer_| to fire when the application idle message should be shown.
43 void ResetTimer();
45 // Invoked by |timer_| to display the application idle message.
46 void OnTimeout();
48 base::OneShotTimer<KioskModeIdleAppNameNotification> timer_;
50 // If set the notification should get shown upon next user activity.
51 bool show_notification_upon_next_user_activity_;
53 // The notification object which owns and shows the notification.
54 scoped_ptr<IdleAppNameNotificationView> notification_;
56 DISALLOW_COPY_AND_ASSIGN(KioskModeIdleAppNameNotification);
59 } // namespace chromeos
61 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_MODE_IDLE_APP_NAME_NOTIFICATION_H_