Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / media / router / media_source.h
blob8943f3f9079d42a0bf824f97ecd63753c24e0d26
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_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_
8 #include <ostream>
9 #include <string>
11 #include "base/hash.h"
13 namespace media_router {
16 class MediaSource {
17 public:
18 using Id = std::string;
20 explicit MediaSource(const MediaSource::Id& id);
21 MediaSource();
22 ~MediaSource();
24 // Gets the ID of the media source.
25 MediaSource::Id id() const;
27 // Returns true if two MediaSource objects use the same media ID.
28 bool Equals(const MediaSource& other) const;
30 // Returns true if a MediaSource is empty or uninitialized.
31 bool Empty() const;
33 // Used for logging.
34 std::string ToString() const;
36 // Hash operator for hash containers.
37 struct Hash {
38 size_t operator()(const MediaSource& source) const {
39 return base::Hash(source.id());
43 private:
44 MediaSource::Id id_;
47 } // namespace media_router
49 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_H_