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

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

Issue 949293004: Add media router common classes and unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: MediaSource struct is now a class Created 5 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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698