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_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 namespace extensions { | 40 namespace extensions { |
41 class EventPageTracker; | 41 class EventPageTracker; |
42 class Extension; | 42 class Extension; |
43 } | 43 } |
44 | 44 |
45 namespace media_router { | 45 namespace media_router { |
46 | 46 |
47 enum class MediaRouteProviderWakeReason; | 47 enum class MediaRouteProviderWakeReason; |
| 48 class CastMediaSinkService; |
48 class DialMediaSinkServiceProxy; | 49 class DialMediaSinkServiceProxy; |
49 | 50 |
50 // MediaRouter implementation that delegates calls to the component extension. | 51 // MediaRouter implementation that delegates calls to the component extension. |
51 // Also handles the suspension and wakeup of the component extension. | 52 // Also handles the suspension and wakeup of the component extension. |
52 // Lives on the UI thread. | 53 // Lives on the UI thread. |
53 class MediaRouterMojoImpl : public MediaRouterBase, | 54 class MediaRouterMojoImpl : public MediaRouterBase, |
54 public mojom::MediaRouter { | 55 public mojom::MediaRouter { |
55 public: | 56 public: |
56 ~MediaRouterMojoImpl() override; | 57 ~MediaRouterMojoImpl() override; |
57 | 58 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // initial event page wakeup attempt. | 466 // initial event page wakeup attempt. |
466 bool provider_version_was_recorded_ = false; | 467 bool provider_version_was_recorded_ = false; |
467 | 468 |
468 // Stores route controllers that can be used to send media commands to the | 469 // Stores route controllers that can be used to send media commands to the |
469 // extension. | 470 // extension. |
470 std::unordered_map<MediaRoute::Id, MediaRouteController*> route_controllers_; | 471 std::unordered_map<MediaRoute::Id, MediaRouteController*> route_controllers_; |
471 | 472 |
472 // Media sink service for DIAL devices. | 473 // Media sink service for DIAL devices. |
473 scoped_refptr<DialMediaSinkServiceProxy> dial_media_sink_service_proxy_; | 474 scoped_refptr<DialMediaSinkServiceProxy> dial_media_sink_service_proxy_; |
474 | 475 |
| 476 // Media sink service for CAST devices. |
| 477 scoped_refptr<CastMediaSinkService> cast_media_sink_service_; |
| 478 |
475 content::BrowserContext* const context_; | 479 content::BrowserContext* const context_; |
476 | 480 |
477 #if defined(OS_WIN) | 481 #if defined(OS_WIN) |
478 // A pair of flags to ensure that mDNS discovery is only enabled on Windows | 482 // A pair of flags to ensure that mDNS discovery is only enabled on Windows |
479 // when there will be appropriate context for the user to associate a firewall | 483 // when there will be appropriate context for the user to associate a firewall |
480 // prompt with Media Router. |should_enable_mdns_discovery_| can only go from | 484 // prompt with Media Router. |should_enable_mdns_discovery_| can only go from |
481 // |false| to |true|. On Windows, |is_mdns_enabled_| is set to |false| in | 485 // |false| to |true|. On Windows, |is_mdns_enabled_| is set to |false| in |
482 // RegisterMediaRouteProvider and only set to |true| when we successfully call | 486 // RegisterMediaRouteProvider and only set to |true| when we successfully call |
483 // the extension to enable mDNS. | 487 // the extension to enable mDNS. |
484 bool is_mdns_enabled_ = false; | 488 bool is_mdns_enabled_ = false; |
485 bool should_enable_mdns_discovery_ = false; | 489 bool should_enable_mdns_discovery_ = false; |
486 #endif | 490 #endif |
487 | 491 |
488 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; | 492 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; |
489 | 493 |
490 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); | 494 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); |
491 }; | 495 }; |
492 | 496 |
493 } // namespace media_router | 497 } // namespace media_router |
494 | 498 |
495 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 499 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
OLD | NEW |