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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_cast_mode.h

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_CAST_MODE_H_
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_CAST_MODE_H_
7
8 #include <set>
9 #include <string>
10
11 namespace media_router {
12
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 or a native application window and stream it to
24 // a media sink. Always available.
25 DESKTOP_OR_WINDOW_MIRROR,
26 // Same as TAB_MIRROR, but capture at a reduced frame rate; suitable for
27 // static or audio-only content. Always available.
28 SOUND_OPTIMIZED_TAB_MIRROR,
29 // The number of cast modes; not a valid cast mode. Add new cast modes above.
30 NUM_CAST_MODES,
31 };
32
33 using CastModeSet = std::set<MediaCastMode>;
34
35 // Returns a localized title string for |mode| and |host| (e.g. google.com).
36 std::string MediaCastModeToTitle(MediaCastMode mode, const std::string& host);
37
38 // Returns a localized description string for |mode| and |host|.
39 std::string MediaCastModeToDescription(MediaCastMode mode,
40 const std::string& host);
41
42 // Returns true if |cast_mode_num| is a valid MediaCastMode, false otherwise.
43 bool IsValidCastModeNum(int cast_mode_num);
44
45 // Returns the preferred cast mode from the current set of cast modes.
46 // There must be at least one cast mode in |cast_modes|.
47 MediaCastMode GetPreferredCastMode(const CastModeSet& cast_modes);
48
49 } // namespace media_router
50
51 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_CAST_MODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698