Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / webui / media_router / media_cast_mode.h
blob94630d2b771c9ad1d8ecb7ddc879210bad2afecb
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_
8 #include <set>
9 #include <string>
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.
16 enum MediaCastMode {
17 // The default presentation for the WebContents. Only available when the
18 // document has provided a default presentation URL.
19 DEFAULT,
20 // Capture the rendered WebContents and stream it to a media sink. Always
21 // available.
22 TAB_MIRROR,
23 // Capture the entire desktop and stream it to a media sink. Always
24 // available.
25 DESKTOP_MIRROR,
26 // The number of cast modes; not a valid cast mode. Add new cast modes above.
27 NUM_CAST_MODES,
30 using CastModeSet = std::set<MediaCastMode>;
32 // Returns a localized description string for |mode| and |host|
33 // (e.g. google.com).
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_