| 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 #include "chrome/browser/media/router/media_router_base.h" | 5 #include "chrome/browser/media/router/media_router_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // MediaRoutesObserver | 25 // MediaRoutesObserver |
| 26 void OnRoutesUpdated( | 26 void OnRoutesUpdated( |
| 27 const std::vector<MediaRoute>& routes, | 27 const std::vector<MediaRoute>& routes, |
| 28 const std::vector<MediaRoute::Id>& joinable_route_ids) override { | 28 const std::vector<MediaRoute::Id>& joinable_route_ids) override { |
| 29 off_the_record_route_ids.clear(); | 29 off_the_record_route_ids.clear(); |
| 30 // TODO(crbug.com/611486): Have the MRPM pass a list of joinable route ids | 30 // TODO(crbug.com/611486): Have the MRPM pass a list of joinable route ids |
| 31 // via |joinable_route_ids|, and check here if it is non-empty. | 31 // via |joinable_route_ids|, and check here if it is non-empty. |
| 32 has_route = !routes.empty(); | 32 has_route = !routes.empty(); |
| 33 for (const auto& route : routes) { | 33 for (const auto& route : routes) { |
| 34 if (route.off_the_record()) | 34 if (route.incognito()) |
| 35 off_the_record_route_ids.push_back(route.media_route_id()); | 35 off_the_record_route_ids.push_back(route.media_route_id()); |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool has_route; | 39 bool has_route; |
| 40 std::vector<MediaRoute::Id> off_the_record_route_ids; | 40 std::vector<MediaRoute::Id> off_the_record_route_ids; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(InternalMediaRoutesObserver); | 43 DISALLOW_COPY_AND_ASSIGN(InternalMediaRoutesObserver); |
| 44 }; | 44 }; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 presentation_connection_state_callbacks_.erase(route_id); | 123 presentation_connection_state_callbacks_.erase(route_id); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void MediaRouterBase::Shutdown() { | 126 void MediaRouterBase::Shutdown() { |
| 127 // The observer calls virtual methods on MediaRouter; it must be destroyed | 127 // The observer calls virtual methods on MediaRouter; it must be destroyed |
| 128 // outside of the dtor | 128 // outside of the dtor |
| 129 internal_routes_observer_.reset(); | 129 internal_routes_observer_.reset(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace media_router | 132 } // namespace media_router |
| OLD | NEW |