OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ |
6 #define CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ | 6 #define CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
9 #include "content/public/browser/power_save_blocker.h" | 11 #include "content/public/browser/power_save_blocker.h" |
10 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 | 15 |
14 class PowerSaveBlockerImpl : public PowerSaveBlocker { | 16 class PowerSaveBlockerImpl : public PowerSaveBlocker { |
15 public: | 17 public: |
16 PowerSaveBlockerImpl(PowerSaveBlockerType type, const std::string& reason); | 18 PowerSaveBlockerImpl(PowerSaveBlockerType type, |
| 19 Reason reason, |
| 20 const std::string& description); |
17 ~PowerSaveBlockerImpl() override; | 21 ~PowerSaveBlockerImpl() override; |
18 | 22 |
19 #if defined(OS_ANDROID) | 23 #if defined(OS_ANDROID) |
20 // In Android platform, the kPowerSaveBlockPreventDisplaySleep type of | 24 // In Android platform, the kPowerSaveBlockPreventDisplaySleep type of |
21 // PowerSaveBlocker should associated with the ViewAndroid, | 25 // PowerSaveBlocker should associated with the ViewAndroid, |
22 // so the blocker could be removed by platform if the view isn't visble | 26 // so the blocker could be removed by platform if the view isn't visble |
23 void InitDisplaySleepBlocker(gfx::NativeView view_android); | 27 void InitDisplaySleepBlocker(gfx::NativeView view_android); |
24 #endif | 28 #endif |
25 | 29 |
26 private: | 30 private: |
(...skipping 10 matching lines...) Expand all Loading... |
37 // ~Delegate() {} | 41 // ~Delegate() {} |
38 // }; | 42 // }; |
39 scoped_refptr<Delegate> delegate_; | 43 scoped_refptr<Delegate> delegate_; |
40 | 44 |
41 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerImpl); | 45 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerImpl); |
42 }; | 46 }; |
43 | 47 |
44 } // namespace content | 48 } // namespace content |
45 | 49 |
46 #endif // CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ | 50 #endif // CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ |
OLD | NEW |