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 26 matching lines...) Expand all Loading... |
37 class BrowserContext; | 37 class BrowserContext; |
38 } | 38 } |
39 | 39 |
40 namespace extensions { | 40 namespace extensions { |
41 class Extension; | 41 class Extension; |
42 } | 42 } |
43 | 43 |
44 namespace media_router { | 44 namespace media_router { |
45 | 45 |
46 enum class MediaRouteProviderWakeReason; | 46 enum class MediaRouteProviderWakeReason; |
47 class CastMediaSinkService; | |
48 class DialMediaSinkServiceProxy; | 47 class DialMediaSinkServiceProxy; |
49 class EventPageRequestManager; | 48 class EventPageRequestManager; |
50 | 49 |
51 // MediaRouter implementation that delegates calls to the component extension. | 50 // MediaRouter implementation that delegates calls to the component extension. |
52 // Also handles the suspension and wakeup of the component extension. | 51 // Also handles the suspension and wakeup of the component extension. |
53 // Lives on the UI thread. | 52 // Lives on the UI thread. |
54 class MediaRouterMojoImpl : public MediaRouterBase, | 53 class MediaRouterMojoImpl : public MediaRouterBase, |
55 public mojom::MediaRouter { | 54 public mojom::MediaRouter { |
56 public: | 55 public: |
57 ~MediaRouterMojoImpl() override; | 56 ~MediaRouterMojoImpl() override; |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // The last reported sink availability from the media route provider manager. | 403 // The last reported sink availability from the media route provider manager. |
405 mojom::MediaRouter::SinkAvailability availability_; | 404 mojom::MediaRouter::SinkAvailability availability_; |
406 | 405 |
407 // Stores route controllers that can be used to send media commands to the | 406 // Stores route controllers that can be used to send media commands to the |
408 // extension. | 407 // extension. |
409 std::unordered_map<MediaRoute::Id, MediaRouteController*> route_controllers_; | 408 std::unordered_map<MediaRoute::Id, MediaRouteController*> route_controllers_; |
410 | 409 |
411 // Media sink service for DIAL devices. | 410 // Media sink service for DIAL devices. |
412 scoped_refptr<DialMediaSinkServiceProxy> dial_media_sink_service_proxy_; | 411 scoped_refptr<DialMediaSinkServiceProxy> dial_media_sink_service_proxy_; |
413 | 412 |
414 // Media sink service for CAST devices. | |
415 scoped_refptr<CastMediaSinkService> cast_media_sink_service_; | |
416 | |
417 content::BrowserContext* const context_; | 413 content::BrowserContext* const context_; |
418 | 414 |
419 // Request manager responsible for waking the component extension and calling | 415 // Request manager responsible for waking the component extension and calling |
420 // the requests to it. | 416 // the requests to it. |
421 EventPageRequestManager* const event_page_request_manager_; | 417 EventPageRequestManager* const event_page_request_manager_; |
422 | 418 |
423 // A flag to ensure that we record the provider version once, during the | 419 // A flag to ensure that we record the provider version once, during the |
424 // initial event page wakeup attempt. | 420 // initial event page wakeup attempt. |
425 bool provider_version_was_recorded_ = false; | 421 bool provider_version_was_recorded_ = false; |
426 | 422 |
427 #if defined(OS_WIN) | 423 #if defined(OS_WIN) |
428 // A pair of flags to ensure that mDNS discovery is only enabled on Windows | 424 // A pair of flags to ensure that mDNS discovery is only enabled on Windows |
429 // when there will be appropriate context for the user to associate a firewall | 425 // when there will be appropriate context for the user to associate a firewall |
430 // prompt with Media Router. |should_enable_mdns_discovery_| can only go from | 426 // prompt with Media Router. |should_enable_mdns_discovery_| can only go from |
431 // |false| to |true|. On Windows, |is_mdns_enabled_| is set to |false| in | 427 // |false| to |true|. On Windows, |is_mdns_enabled_| is set to |false| in |
432 // RegisterMediaRouteProvider and only set to |true| when we successfully call | 428 // RegisterMediaRouteProvider and only set to |true| when we successfully call |
433 // the extension to enable mDNS. | 429 // the extension to enable mDNS. |
434 bool is_mdns_enabled_ = false; | 430 bool is_mdns_enabled_ = false; |
435 bool should_enable_mdns_discovery_ = false; | 431 bool should_enable_mdns_discovery_ = false; |
436 #endif | 432 #endif |
437 | 433 |
438 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; | 434 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; |
439 | 435 |
440 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); | 436 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); |
441 }; | 437 }; |
442 | 438 |
443 } // namespace media_router | 439 } // namespace media_router |
444 | 440 |
445 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 441 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
OLD | NEW |