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.
5 #ifndef CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_SCREENSAVER_H_
6 #define CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_SCREENSAVER_H_
8 #include "ash/wm/user_activity_observer.h"
9 #include "base/basictypes.h"
10 #include "base/files/file_path.h"
11 #include "base/memory/weak_ptr.h"
13 namespace extensions
{
19 class KioskModeScreensaver
: public ash::UserActivityObserver
{
21 KioskModeScreensaver();
22 virtual ~KioskModeScreensaver();
25 friend class KioskModeScreensaverTest
;
27 // UserActivityObserver overrides:
28 virtual void OnUserActivity(const ui::Event
* event
) OVERRIDE
;
30 // Initialization functions, in order
31 // Get the screensaver path once KioskModeHelper is initialized.
32 void GetScreensaverCrxPath();
34 // Callback to receive the path to the screensaver extension's crx and call
35 // the unpacker to unpack and load the crx.
36 void ScreensaverPathCallback(const base::FilePath
& screensaver_crx
);
38 // Called back on the UI thread to Setup the screensaver with the now unpacked
39 // and loaded extension.
40 void SetupScreensaver(scoped_refptr
<extensions::Extension
> extension
,
41 const base::FilePath
& extension_base_path
);
43 base::WeakPtrFactory
<KioskModeScreensaver
> weak_ptr_factory_
;
45 base::FilePath extension_base_path_
;
47 DISALLOW_COPY_AND_ASSIGN(KioskModeScreensaver
);
50 void InitializeKioskModeScreensaver();
51 void ShutdownKioskModeScreensaver();
53 } // namespace chromeos
55 #endif // CHROME_BROWSER_CHROMEOS_KIOSK_MODE_KIOSK_MODE_SCREENSAVER_H_