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

Unified Diff: media/base/overlay_info.h

Issue 2892083002: Send enter / exit fullscreen signal to AVDA (Closed)
Patch Set: more cl feedback Created 3 years, 7 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
Index: media/base/overlay_info.h
diff --git a/media/base/overlay_info.h b/media/base/overlay_info.h
index da0c387dcbcfcc65e3c96ea27cbb733fbeca478c..8a2975c8442159325ff2654bbb491443fededbbb 100644
--- a/media/base/overlay_info.h
+++ b/media/base/overlay_info.h
@@ -9,13 +9,56 @@
#include "base/macros.h"
#include "base/optional.h"
#include "base/unguessable_token.h"
+#include "media/base/media_export.h"
namespace media {
+struct MEDIA_EXPORT OverlayInfo {
+ OverlayInfo();
+ OverlayInfo(const OverlayInfo&);
+
+ // Copy all values specified in |other| into |this|, and leave unchanged any
+ // that |other| doesn't specify.
+ void MergeWith(const OverlayInfo& other);
+
+ // An unset routing token indicates "do not use any routing token". A null
+ // routing token isn't serializable, else we'd probably use that instead.
+ using RoutingToken = base::Optional<base::UnguessableToken>;
watk 2017/05/25 18:09:35 Move to the top. From the style guide: Within ea
liberato (no reviews please) 2017/05/25 21:26:56 Done.
+
+ // If any of these are not provided, then the intention is that this message
+ // does not make any claims about them. For example, one might receive an
+ // OverlayInfo with |routing_token| supplied, then a later one with
+ // |is_fullscreen| supplied. The first message makes no claims about whether
+ // one is in fullscreen or not. The second one does not provide any update
+ // to the routing token.
+
+ // Of course, one message may specify more than one of these.
+
+ // If provided, this is the SurfaceManager surface id, or
+ // SurfaceManager::kNoSurfaceID to indicate that no surface should be used.
+ base::Optional<int> surface_id;
+
+ // If provided, the mojo AndroidOverlay routing token or "use no token" if
+ // !(*routing_token). Note the extra indirection; |routing_token| is, itself,
+ // a base::Optional.
+ base::Optional<RoutingToken> routing_token;
+
+ // If provided, indicates whether we're in fullscreen mode or not.
+ base::Optional<bool> is_fullscreen;
+
+ // NOTE: if one adds any other members, then be sure to update MergeWith to
+ // copy them as well. Also add a test to overlay_info_unittest.
+
+ // Convenience functions to return true if and only if this specifies a
+ // surface ID / routing token that is not kNoSurfaceID / empty. I.e., if we
+ // provide enough info to create an overlay.
+ bool HasValidSurfaceId() const;
watk 2017/05/25 18:09:35 Move above member variables
liberato (no reviews please) 2017/05/25 21:26:56 Done.
+ bool HasValidRoutingToken() const;
+};
+
// Request information to construct an overlay. This can be either a surface_id
// or an AndroidOverlay routing token.
watk 2017/05/25 18:09:35 Second sentence out of date (mostly)
liberato (no reviews please) 2017/05/25 21:26:56 Done.
-using ProvideOverlayInfoCB =
- base::Callback<void(int, const base::Optional<base::UnguessableToken>&)>;
+using ProvideOverlayInfoCB = base::Callback<void(const OverlayInfo&)>;
using RequestOverlayInfoCB =
base::Callback<void(bool, const ProvideOverlayInfoCB&)>;

Powered by Google App Engine
This is Rietveld 408576698