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_POWER_RENDERER_FREEZER_H_
6 #define CHROME_BROWSER_CHROMEOS_POWER_RENDERER_FREEZER_H_
8 #include "base/files/file_path.h"
9 #include "base/time/time.h"
10 #include "chromeos/chromeos_export.h"
11 #include "chromeos/dbus/power_manager_client.h"
15 // Freezes the chrome renderers when the system is about to suspend and thaws
16 // them after the system fully resumes. This class registers itself as a
17 // PowerManagerClient::Observer on creation and unregisters itself on
19 class CHROMEOS_EXPORT RendererFreezer : public PowerManagerClient::Observer {
22 virtual ~RendererFreezer();
24 // PowerManagerClient::Observer implementation
25 virtual void SuspendImminent() OVERRIDE;
26 virtual void SuspendDone(const base::TimeDelta& sleep_duration) OVERRIDE;
29 base::FilePath state_path_;
33 DISALLOW_COPY_AND_ASSIGN(RendererFreezer);
36 } // namespace chromeos
38 #endif // CHROME_BROWSER_CHROMEOS_POWER_RENDERER_FREEZER_H_