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 12 matching lines...) Expand all Loading... |
23 #include "base/optional.h" | 23 #include "base/optional.h" |
24 #include "base/threading/thread_task_runner_handle.h" | 24 #include "base/threading/thread_task_runner_handle.h" |
25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
26 #include "chrome/browser/media/router/issue_manager.h" | 26 #include "chrome/browser/media/router/issue_manager.h" |
27 #include "chrome/browser/media/router/media_router_base.h" | 27 #include "chrome/browser/media/router/media_router_base.h" |
28 #include "chrome/browser/media/router/media_routes_observer.h" | 28 #include "chrome/browser/media/router/media_routes_observer.h" |
29 #include "chrome/common/media_router/issue.h" | 29 #include "chrome/common/media_router/issue.h" |
30 #include "chrome/common/media_router/mojo/media_router.mojom.h" | 30 #include "chrome/common/media_router/mojo/media_router.mojom.h" |
31 #include "chrome/common/media_router/route_request_result.h" | 31 #include "chrome/common/media_router/route_request_result.h" |
32 #include "mojo/public/cpp/bindings/binding.h" | 32 #include "mojo/public/cpp/bindings/binding.h" |
| 33 #include "services/service_manager/public/cpp/bind_source_info.h" |
33 | 34 |
34 namespace content { | 35 namespace content { |
35 class BrowserContext; | 36 class BrowserContext; |
36 } | 37 } |
37 | 38 |
38 namespace extensions { | 39 namespace extensions { |
39 class EventPageTracker; | 40 class EventPageTracker; |
40 class Extension; | 41 class Extension; |
41 } | 42 } |
42 | 43 |
(...skipping 11 matching lines...) Expand all Loading... |
54 | 55 |
55 // Sets up the MediaRouterMojoImpl instance owned by |context| to handle | 56 // Sets up the MediaRouterMojoImpl instance owned by |context| to handle |
56 // MediaRouterObserver requests from the component extension given by | 57 // MediaRouterObserver requests from the component extension given by |
57 // |extension|. Creates the MediaRouterMojoImpl instance if it does not | 58 // |extension|. Creates the MediaRouterMojoImpl instance if it does not |
58 // exist. | 59 // exist. |
59 // Called by the Mojo module registry. | 60 // Called by the Mojo module registry. |
60 // |extension|: The component extension, used for querying | 61 // |extension|: The component extension, used for querying |
61 // suspension state. | 62 // suspension state. |
62 // |context|: The BrowserContext which owns the extension process. | 63 // |context|: The BrowserContext which owns the extension process. |
63 // |request|: The Mojo connection request used for binding. | 64 // |request|: The Mojo connection request used for binding. |
64 static void BindToRequest( | 65 static void BindToRequest(const extensions::Extension* extension, |
65 const extensions::Extension* extension, | 66 content::BrowserContext* context, |
66 content::BrowserContext* context, | 67 const service_manager::BindSourceInfo& source_info, |
67 mojo::InterfaceRequest<mojom::MediaRouter> request); | 68 mojom::MediaRouterRequest request); |
68 | 69 |
69 // MediaRouter implementation. | 70 // MediaRouter implementation. |
70 // Execution of the requests is delegated to the Do* methods, which can be | 71 // Execution of the requests is delegated to the Do* methods, which can be |
71 // enqueued for later use if the extension is temporarily suspended. | 72 // enqueued for later use if the extension is temporarily suspended. |
72 void CreateRoute(const MediaSource::Id& source_id, | 73 void CreateRoute(const MediaSource::Id& source_id, |
73 const MediaSink::Id& sink_id, | 74 const MediaSink::Id& sink_id, |
74 const url::Origin& origin, | 75 const url::Origin& origin, |
75 content::WebContents* web_contents, | 76 content::WebContents* web_contents, |
76 const std::vector<MediaRouteResponseCallback>& callbacks, | 77 const std::vector<MediaRouteResponseCallback>& callbacks, |
77 base::TimeDelta timeout, | 78 base::TimeDelta timeout, |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 #endif | 482 #endif |
482 | 483 |
483 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; | 484 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; |
484 | 485 |
485 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); | 486 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); |
486 }; | 487 }; |
487 | 488 |
488 } // namespace media_router | 489 } // namespace media_router |
489 | 490 |
490 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ | 491 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ |
OLD | NEW |