[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / content / browser / power_save_blocker_impl.h
blob7ba0b5429b858439b57705abc41ae6fecb32fa1f
1 // Copyright (c) 2013 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 CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_
6 #define CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_
8 #include <string>
10 #include "base/memory/ref_counted.h"
11 #include "content/public/browser/power_save_blocker.h"
12 #include "ui/gfx/native_widget_types.h"
14 namespace content {
16 class PowerSaveBlockerImpl : public PowerSaveBlocker {
17 public:
18 PowerSaveBlockerImpl(PowerSaveBlockerType type,
19 Reason reason,
20 const std::string& description);
21 ~PowerSaveBlockerImpl() override;
23 #if defined(OS_ANDROID)
24 // In Android platform, the kPowerSaveBlockPreventDisplaySleep type of
25 // PowerSaveBlocker should associated with the ViewAndroid,
26 // so the blocker could be removed by platform if the view isn't visble
27 void InitDisplaySleepBlocker(gfx::NativeView view_android);
28 #endif
30 private:
31 class Delegate;
33 // Implementations of this class may need a second object with different
34 // lifetime than the RAII container, or additional storage. This member is
35 // here for that purpose. If not used, just define the class as an empty
36 // RefCounted (or RefCountedThreadSafe) like so to make it compile:
37 // class PowerSaveBlocker::Delegate
38 // : public base::RefCounted<PowerSaveBlocker::Delegate> {
39 // private:
40 // friend class base::RefCounted<Delegate>;
41 // ~Delegate() {}
42 // };
43 scoped_refptr<Delegate> delegate_;
45 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerImpl);
48 } // namespace content
50 #endif // CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_