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/ui/webui/media_router/media_router_ui.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "chrome/browser/media/router/create_session_request.h" | 10 #include "chrome/browser/media/router/create_session_request.h" |
11 #include "chrome/browser/media/router/issue.h" | 11 #include "chrome/browser/media/router/issue.h" |
12 #include "chrome/browser/media/router/issues_observer.h" | 12 #include "chrome/browser/media/router/issues_observer.h" |
13 #include "chrome/browser/media/router/media_route.h" | 13 #include "chrome/browser/media/router/media_route.h" |
14 #include "chrome/browser/media/router/media_router.h" | 14 #include "chrome/browser/media/router/media_router.h" |
| 15 #include "chrome/browser/media/router/media_router_factory.h" |
15 #include "chrome/browser/media/router/media_router_mojo_impl.h" | 16 #include "chrome/browser/media/router/media_router_mojo_impl.h" |
16 #include "chrome/browser/media/router/media_router_mojo_impl_factory.h" | |
17 #include "chrome/browser/media/router/media_routes_observer.h" | 17 #include "chrome/browser/media/router/media_routes_observer.h" |
18 #include "chrome/browser/media/router/media_sink.h" | 18 #include "chrome/browser/media/router/media_sink.h" |
19 #include "chrome/browser/media/router/media_sinks_observer.h" | 19 #include "chrome/browser/media/router/media_sinks_observer.h" |
20 #include "chrome/browser/media/router/media_source.h" | 20 #include "chrome/browser/media/router/media_source.h" |
21 #include "chrome/browser/media/router/media_source_helper.h" | 21 #include "chrome/browser/media/router/media_source_helper.h" |
22 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 22 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/sessions/session_tab_helper.h" | 24 #include "chrome/browser/sessions/session_tab_helper.h" |
25 #include "chrome/browser/ui/webui/media_router/media_router_localized_strings_pr
ovider.h" | 25 #include "chrome/browser/ui/webui/media_router/media_router_localized_strings_pr
ovider.h" |
26 #include "chrome/browser/ui/webui/media_router/media_router_resources_provider.h
" | 26 #include "chrome/browser/ui/webui/media_router/media_router_resources_provider.h
" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 router_(nullptr), | 95 router_(nullptr), |
96 weak_factory_(this) { | 96 weak_factory_(this) { |
97 // Create a WebUIDataSource containing the chrome://media-router page's | 97 // Create a WebUIDataSource containing the chrome://media-router page's |
98 // content. | 98 // content. |
99 scoped_ptr<content::WebUIDataSource> html_source( | 99 scoped_ptr<content::WebUIDataSource> html_source( |
100 content::WebUIDataSource::Create(chrome::kChromeUIMediaRouterHost)); | 100 content::WebUIDataSource::Create(chrome::kChromeUIMediaRouterHost)); |
101 | 101 |
102 content::WebContents* wc = web_ui->GetWebContents(); | 102 content::WebContents* wc = web_ui->GetWebContents(); |
103 DCHECK(wc); | 103 DCHECK(wc); |
104 | 104 |
105 router_ = MediaRouterMojoImplFactory::GetApiForBrowserContext( | 105 router_ = MediaRouterFactory::GetApiForBrowserContext( |
106 wc->GetBrowserContext()); | 106 wc->GetBrowserContext()); |
107 DCHECK(router_); | 107 DCHECK(router_); |
108 | 108 |
109 AddLocalizedStrings(html_source.get()); | 109 AddLocalizedStrings(html_source.get()); |
110 AddMediaRouterUIResources(html_source.get()); | 110 AddMediaRouterUIResources(html_source.get()); |
111 // Ownership of |html_source| is transferred to the BrowserContext. | 111 // Ownership of |html_source| is transferred to the BrowserContext. |
112 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), | 112 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), |
113 html_source.release()); | 113 html_source.release()); |
114 | 114 |
115 // Ownership of |handler_| is transferred to |web_ui|. | 115 // Ownership of |handler_| is transferred to |web_ui|. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 base::Bind(&MediaRouterUI::OnRouteResponseReceived, | 334 base::Bind(&MediaRouterUI::OnRouteResponseReceived, |
335 weak_factory_.GetWeakPtr())); | 335 weak_factory_.GetWeakPtr())); |
336 return true; | 336 return true; |
337 } | 337 } |
338 | 338 |
339 std::string MediaRouterUI::GetFrameURLHost() const { | 339 std::string MediaRouterUI::GetFrameURLHost() const { |
340 return GetHostFromURL(frame_url_); | 340 return GetHostFromURL(frame_url_); |
341 } | 341 } |
342 | 342 |
343 } // namespace media_router | 343 } // namespace media_router |
OLD | NEW |