| 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_TEST_MEDIA_ROUTER_MEDIA_ROUTER_E2E_BROWSERTEST_H_ | 5 #ifndef CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_E2E_BROWSERTEST_H_ |
| 6 #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_E2E_BROWSERTEST_H_ | 6 #define CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_E2E_BROWSERTEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // finds sink with name matching receiver_, and establishes media | 37 // finds sink with name matching receiver_, and establishes media |
| 38 // route between the source and sink. | 38 // route between the source and sink. |
| 39 // |observer_| and |route_id_| will be initialized. | 39 // |observer_| and |route_id_| will be initialized. |
| 40 // |origin| is the URL of requestor's page. | 40 // |origin| is the URL of requestor's page. |
| 41 // |web_contents| identifies the tab in which the request was made. | 41 // |web_contents| identifies the tab in which the request was made. |
| 42 // |origin| and |web_contents| are used for enforcing same-origin and/or | 42 // |origin| and |web_contents| are used for enforcing same-origin and/or |
| 43 // same-tab scope for JoinRoute() requests. (e.g., if enforced, the page | 43 // same-tab scope for JoinRoute() requests. (e.g., if enforced, the page |
| 44 // requesting JoinRoute() must have the same origin as the page that | 44 // requesting JoinRoute() must have the same origin as the page that |
| 45 // requested CreateRoute()). | 45 // requested CreateRoute()). |
| 46 void CreateMediaRoute(const MediaSource& source, | 46 void CreateMediaRoute(const MediaSource& source, |
| 47 const GURL& origin, | 47 const url::Origin& origin, |
| 48 content::WebContents* web_contents); | 48 content::WebContents* web_contents); |
| 49 | 49 |
| 50 // Stops the established media route and unregisters |observer_|. | 50 // Stops the established media route and unregisters |observer_|. |
| 51 // Note that the route may not be stopped immediately, as it makes an | 51 // Note that the route may not be stopped immediately, as it makes an |
| 52 // async call to the Media Route Provider. | 52 // async call to the Media Route Provider. |
| 53 // |observer_| and |route_id_| will be reset. | 53 // |observer_| and |route_id_| will be reset. |
| 54 void StopMediaRoute(); | 54 void StopMediaRoute(); |
| 55 | 55 |
| 56 bool IsSinkDiscovered() const; | 56 bool IsSinkDiscovered() const; |
| 57 bool IsRouteCreated() const; | 57 bool IsRouteCreated() const; |
| 58 | 58 |
| 59 void OpenMediaPage(); | 59 void OpenMediaPage(); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 MediaRouter* media_router_; | 62 MediaRouter* media_router_; |
| 63 std::unique_ptr<TestMediaSinksObserver> observer_; | 63 std::unique_ptr<TestMediaSinksObserver> observer_; |
| 64 MediaRoute::Id route_id_; | 64 MediaRoute::Id route_id_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace media_router | 67 } // namespace media_router |
| 68 | 68 |
| 69 #endif // CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_E2E_BROWSERTEST_H_ | 69 #endif // CHROME_TEST_MEDIA_ROUTER_MEDIA_ROUTER_E2E_BROWSERTEST_H_ |
| OLD | NEW |