OLD | NEW |
---|---|
(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_MEDIA_ROUTER_MEDIA_SOURCE_H_ | |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace media_router { | |
11 | |
12 class MediaSource { | |
13 public: | |
14 MediaSource() = default; | |
15 MediaSource(const MediaSource& other) = default; | |
16 virtual ~MediaSource(); | |
xhwang
2015/03/09 17:37:31
Is MediaSources a base class? Wondering whether we
Kevin M
2015/03/09 23:32:06
Done.
Kevin M
2015/03/09 23:32:06
Done.
| |
17 | |
18 // Static creation methods for various media types. | |
19 static MediaSource ForTab(int tab_id); | |
20 static MediaSource ForDesktop(); | |
21 static MediaSource ForCastApp(const std::string& app_id); | |
22 static MediaSource ForPresentationUrl(const std::string& presentation_url); | |
23 | |
24 // Sets the ID of a MediaSource object to |id| if it is valid. | |
25 // Returns true if |id| is valid and the MediaSource is modified. | |
26 // Returns false and leaves the MediaSource untouched if |id| is invalid. | |
27 bool Parse(const std::string& id); | |
xhwang
2015/03/09 17:37:31
Hmm, the default ctor and this function provide an
Kevin M
2015/03/09 23:32:06
I agree that this is unclear. I've moved the creat
| |
28 | |
29 // Gets the ID of the media source. | |
30 const std::string& id() const; | |
31 | |
32 // Checks if the media source uses display mirroring. | |
33 bool SupportsMirroring() const; | |
34 | |
35 protected: | |
36 explicit MediaSource(const std::string& source_id); | |
37 | |
38 private: | |
39 static bool IsValid(); | |
xhwang
2015/03/09 17:37:31
not defined?
Kevin M
2015/03/09 23:32:06
Acknowledged.
| |
40 | |
41 std::string id_; | |
42 }; | |
43 | |
44 } // namespace media_router | |
45 | |
46 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_ | |
OLD | NEW |