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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/power_save_blocker.h
diff --git a/content/public/browser/power_save_blocker.h b/content/public/browser/power_save_blocker.h
index fe9f9661e4a9ca76f0abeb0c3cfd8daeffd68a7d..813c8783068b66671c24f173f0cf18f37456c948 100644
--- a/content/public/browser/power_save_blocker.h
+++ b/content/public/browser/power_save_blocker.h
@@ -32,13 +32,26 @@ class CONTENT_EXPORT PowerSaveBlocker {
kPowerSaveBlockPreventDisplaySleep,
};
+ // Reasons why power-saving features may be blocked.
+ enum Reason {
+ // Audio is being played.
+ kReasonAudioPlayback,
+ // Video is being played.
+ kReasonVideoPlayback,
+ // Power-saving is blocked for some other reason.
+ kReasonOther,
+ };
+
virtual ~PowerSaveBlocker() = 0;
// Pass in the type of power save blocking desired. If multiple types of
// blocking are desired, instantiate one PowerSaveBlocker for each type.
- // |reason| may be provided to the underlying system APIs on some platforms.
+ // |reason| and |description| (a more-verbose, human-readable justification of
+ // the blocking) may be provided to the underlying system APIs on some
+ // platforms.
static scoped_ptr<PowerSaveBlocker> Create(PowerSaveBlockerType type,
- const std::string& reason);
+ Reason reason,
+ const std::string& description);
};
} // namespace content
« 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