| OLD | NEW |
| 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_ROUTE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/media/router/media_route_id.h" | 13 #include "chrome/browser/media/router/media_route_id.h" |
| 14 #include "chrome/browser/media/router/media_sink.h" | 14 #include "chrome/browser/media/router/media_sink.h" |
| 15 #include "chrome/browser/media/router/media_source.h" | 15 #include "chrome/browser/media/router/media_source.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 namespace media_router { | 18 namespace media_router { |
| 19 | 19 |
| 20 using RouteRequestId = int64; | 20 using RouteRequestId = int64; |
| 21 | 21 const RouteRequestId kInvalidRouteRequestId = -1; |
| 22 class MediaRouteFactory; | |
| 23 | 22 |
| 24 // For now, a simple transition graph: NEW -> CONNECTED -> CLOSED. | 23 // For now, a simple transition graph: NEW -> CONNECTED -> CLOSED. |
| 25 enum MediaRouteState { | 24 enum MediaRouteState { |
| 26 // The route is new and not yet connected to a sink. | 25 // The route is new and not yet connected to a sink. |
| 27 MEDIA_ROUTE_STATE_NEW, | 26 MEDIA_ROUTE_STATE_NEW, |
| 28 // The route is active and connected to a sink. | 27 // The route is active and connected to a sink. |
| 29 MEDIA_ROUTE_STATE_CONNECTED, | 28 MEDIA_ROUTE_STATE_CONNECTED, |
| 30 // The route has been disconnected. | 29 // The route has been disconnected. |
| 31 MEDIA_ROUTE_STATE_CLOSED | 30 MEDIA_ROUTE_STATE_CLOSED |
| 32 }; | 31 }; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // TODO(kmarshall): Do we need to pass locale for bidi rendering? | 67 // TODO(kmarshall): Do we need to pass locale for bidi rendering? |
| 69 const std::string& description() const { return description_; } | 68 const std::string& description() const { return description_; } |
| 70 | 69 |
| 71 // Returns |true| if the route is created locally (versus discovered | 70 // Returns |true| if the route is created locally (versus discovered |
| 72 // by a media route provider.) | 71 // by a media route provider.) |
| 73 bool is_local() const { return is_local_; } | 72 bool is_local() const { return is_local_; } |
| 74 | 73 |
| 75 bool Equals(const MediaRoute& other) const; | 74 bool Equals(const MediaRoute& other) const; |
| 76 | 75 |
| 77 private: | 76 private: |
| 78 const MediaRouteId media_route_id_; | 77 MediaRouteId media_route_id_; |
| 79 const MediaSource media_source_; | 78 MediaSource media_source_; |
| 80 const MediaSink media_sink_; | 79 MediaSink media_sink_; |
| 81 const std::string description_; | 80 std::string description_; |
| 82 const bool is_local_; | 81 bool is_local_; |
| 83 const MediaRouteState state_; | 82 MediaRouteState state_; |
| 84 }; | 83 }; |
| 85 | 84 |
| 86 } // namespace media_router | 85 } // namespace media_router |
| 87 | 86 |
| 88 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ | 87 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTE_H_ |
| OLD | NEW |