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

Side by Side Diff: chrome/browser/media/router/media_source_helper.h

Issue 1693963003: Pass origin to StartObservingMediaSinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marks Review Fixes with URL changes Created 4 years, 9 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/media/router/media_source.h" 10 #include "chrome/browser/media/router/media_source.h"
11 #include "url/gurl.h"
11 12
12 namespace media_router { 13 namespace media_router {
13 14
14 // Helper library for protocol-specific media source object creation. 15 // Helper library for protocol-specific media source object creation.
15 // Returns MediaSource URI depending on the type of source. 16 // Returns MediaSource URI depending on the type of source.
16 MediaSource MediaSourceForTab(int tab_id); 17 MediaSource MediaSourceForTab(int tab_id);
17 MediaSource MediaSourceForDesktop(); 18 MediaSource MediaSourceForDesktop();
18 MediaSource MediaSourceForCastApp(const std::string& app_id); 19 MediaSource MediaSourceForCastApp(const std::string& app_id);
19 MediaSource MediaSourceForPresentationUrl(const std::string& presentation_url); 20 MediaSource MediaSourceForPresentationUrl(const std::string& presentation_url,
21 const std::string& origin);
22
23 GURL OriginForDesktop();
20 24
21 // Returns true if |source| outputs its content via mirroring. 25 // Returns true if |source| outputs its content via mirroring.
22 bool IsDesktopMirroringMediaSource(const MediaSource& source); 26 bool IsDesktopMirroringMediaSource(const MediaSource& source);
23 bool IsTabMirroringMediaSource(const MediaSource& source); 27 bool IsTabMirroringMediaSource(const MediaSource& source);
24 bool IsMirroringMediaSource(const MediaSource& source); 28 bool IsMirroringMediaSource(const MediaSource& source);
25 29
26 // Checks that |source| is a parseable URN and is of a known type. 30 // Checks that |source| is a parseable URN and is of a known type.
27 // Does not deeper protocol-level syntax checks. 31 // Does not deeper protocol-level syntax checks.
28 bool IsValidMediaSource(const MediaSource& source); 32 bool IsValidMediaSource(const MediaSource& source);
29 33
30 // Extracts the presentation URL from |source|. 34 // Extracts the presentation URL from |source|.
31 // If |source| is invalid, an empty string is returned. 35 // If |source| is invalid, an empty string is returned.
32 std::string PresentationUrlFromMediaSource(const MediaSource& source); 36 std::string PresentationUrlFromMediaSource(const MediaSource& source);
33 37
34 // Returns true if |source| is a valid presentation URL. 38 // Returns true if |source| is a valid presentation URL.
35 bool IsValidPresentationUrl(const std::string& url); 39 bool IsValidPresentationUrl(const std::string& url);
36 40
37 } // namespace media_router 41 } // namespace media_router
38 42
39 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_ 43 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/media/router/media_source.cc ('k') | chrome/browser/media/router/media_source_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698