Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: content/public/browser/power_save_blocker.h

Issue 946643002: Use PowerSaveBlocker for audio and video on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply nits Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_
6 #define CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ 6 #define CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 14 matching lines...) Expand all
25 // Example use cases: downloading a file, playing audio. 25 // Example use cases: downloading a file, playing audio.
26 kPowerSaveBlockPreventAppSuspension, 26 kPowerSaveBlockPreventAppSuspension,
27 27
28 // Prevent the display from going to sleep. This also has the side effect of 28 // Prevent the display from going to sleep. This also has the side effect of
29 // preventing the system from sleeping, but does not necessarily prevent the 29 // preventing the system from sleeping, but does not necessarily prevent the
30 // app from being suspended on some platforms if the user hides it. 30 // app from being suspended on some platforms if the user hides it.
31 // Example use case: playing video. 31 // Example use case: playing video.
32 kPowerSaveBlockPreventDisplaySleep, 32 kPowerSaveBlockPreventDisplaySleep,
33 }; 33 };
34 34
35 // Reasons why power-saving features may be blocked.
36 enum Reason {
37 // Audio is being played.
38 kReasonAudioPlayback,
39 // Video is being played.
40 kReasonVideoPlayback,
41 // Power-saving is blocked for some other reason.
42 kReasonOther,
43 };
44
35 virtual ~PowerSaveBlocker() = 0; 45 virtual ~PowerSaveBlocker() = 0;
36 46
37 // Pass in the type of power save blocking desired. If multiple types of 47 // Pass in the type of power save blocking desired. If multiple types of
38 // blocking are desired, instantiate one PowerSaveBlocker for each type. 48 // blocking are desired, instantiate one PowerSaveBlocker for each type.
39 // |reason| may be provided to the underlying system APIs on some platforms. 49 // |reason| and |description| (a more-verbose, human-readable justification of
50 // the blocking) may be provided to the underlying system APIs on some
51 // platforms.
40 static scoped_ptr<PowerSaveBlocker> Create(PowerSaveBlockerType type, 52 static scoped_ptr<PowerSaveBlocker> Create(PowerSaveBlockerType type,
41 const std::string& reason); 53 Reason reason,
54 const std::string& description);
42 }; 55 };
43 56
44 } // namespace content 57 } // namespace content
45 58
46 #endif // CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ 59 #endif // CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | extensions/browser/api/power/power_api_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698