OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_SCREENSAVER_SCREENSAVER_CONTROLLER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_SCREENSAVER_SCREENSAVER_CONTROLLER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "ash/wm/user_activity_observer.h" | |
11 #include "base/basictypes.h" | |
12 #include "base/gtest_prod_util.h" | |
13 #include "base/memory/weak_ptr.h" | |
14 #include "base/time.h" | |
15 #include "chromeos/dbus/power_manager_client.h" | |
16 #include "content/public/browser/notification_observer.h" | |
17 #include "content/public/browser/notification_registrar.h" | |
18 | |
19 namespace extensions { | |
20 class Extension; | |
21 } | |
22 | |
23 namespace chromeos { | |
24 | |
25 class ScreensaverController : public ash::UserActivityObserver, | |
Matt Perry
2013/01/31 00:37:23
please add a class comment
rkc
2013/01/31 02:15:46
Done.
| |
26 public PowerManagerClient::Observer, | |
27 public content::NotificationObserver { | |
28 public: | |
29 ScreensaverController(); | |
30 virtual ~ScreensaverController(); | |
31 | |
32 private: | |
33 FRIEND_TEST_ALL_PREFIXES(ScreensaverControllerTest, Basic); | |
34 FRIEND_TEST_ALL_PREFIXES(ScreensaverControllerTest, OutOfOrder); | |
35 | |
36 // Overridden from content::NotificationObserver: | |
37 virtual void Observe(int type, | |
38 const content::NotificationSource& source, | |
39 const content::NotificationDetails& details) OVERRIDE; | |
40 | |
41 // Overridden from PowerManagerClient::Observer: | |
42 virtual void IdleNotify(int64 threshold) OVERRIDE; | |
43 | |
44 // UserActivityObserver::Observer overrides: | |
45 virtual void OnUserActivity() OVERRIDE; | |
46 | |
47 void SetupScreensaver(const std::string& screensaver_extension_id); | |
48 void TeardownScreensaver(); | |
49 | |
50 void RequestNextIdleNotification(); | |
51 | |
52 std::string screensaver_extension_id_; | |
53 | |
54 content::NotificationRegistrar registrar_; | |
55 | |
56 base::TimeDelta threshold_; | |
57 | |
58 base::WeakPtrFactory<ScreensaverController> weak_ptr_factory_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(ScreensaverController); | |
61 }; | |
62 | |
63 } // namespace chromeos | |
64 | |
65 #endif // CHROME_BROWSER_CHROMEOS_SCREENSAVER_SCREENSAVER_CONTROLLER_H_ | |
OLD | NEW |