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_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_
10 #include "chrome/browser/media/router/media_source.h"
12 namespace media_router
{
14 // Helper library for protocol-specific media source object creation.
15 // Returns MediaSource URI depending on the type of source.
16 MediaSource
MediaSourceForTab(int tab_id
);
17 MediaSource
MediaSourceForDesktop();
18 MediaSource
MediaSourceForCastApp(const std::string
& app_id
);
19 MediaSource
MediaSourceForPresentationUrl(const std::string
& presentation_url
);
21 // Returns true if |source| outputs its content via mirroring.
22 bool IsMirroringMediaSource(const MediaSource
& source
);
24 // Checks that |source| is a parseable URN and is of a known type.
25 // Does not deeper protocol-level syntax checks.
26 bool IsValidMediaSource(const MediaSource
& source
);
28 // Extracts the presentation URL from |source|.
29 // If |source| is invalid, an empty string is returned.
30 std::string
PresentationUrlFromMediaSource(const MediaSource
& source
);
32 // Returns true if |source| is a valid presentation URL.
33 bool IsValidPresentationUrl(const std::string
& url
);
35 } // namespace media_router
37 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_