1 // Copyright 2015 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 CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_CAST_MODE_H_
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_CAST_MODE_H_
11 namespace media_router
{
13 // A cast mode represents one way that the current WebContents (i.e., tab) may
14 // be presented to a media sink. These must be declared in the priority order
15 // returned by GetPreferredCastMode.
17 // The default presentation for the WebContents. Only available when the
18 // document has provided a default presentation URL.
20 // Capture the rendered WebContents and stream it to a media sink. Always
23 // Capture the entire desktop and stream it to a media sink. Always
26 // The number of cast modes; not a valid cast mode. Add new cast modes above.
30 using CastModeSet
= std::set
<MediaCastMode
>;
32 // Returns a localized description string for |mode| and |host|
34 std::string
MediaCastModeToDescription(MediaCastMode mode
,
35 const std::string
& host
);
37 // Returns true if |cast_mode_num| is a valid MediaCastMode, false otherwise.
38 bool IsValidCastModeNum(int cast_mode_num
);
40 // Returns the preferred cast mode from the current set of cast modes.
41 // There must be at least one cast mode in |cast_modes|.
42 MediaCastMode
GetPreferredCastMode(const CastModeSet
& cast_modes
);
44 } // namespace media_router
46 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_CAST_MODE_H_