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_presentation_session_request.h" | 10 #include "chrome/browser/media/router/create_presentation_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_dialog_controller.h" | 25 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im pl.h" |
mark a. foltz
2015/07/22 21:16:39
Was this change intentional?
whywhat
2015/07/22 22:55:01
Yes, to avoid breaking the file. It seems to be un
| |
26 #include "chrome/browser/ui/webui/media_router/media_router_localized_strings_pr ovider.h" | 26 #include "chrome/browser/ui/webui/media_router/media_router_localized_strings_pr ovider.h" |
27 #include "chrome/browser/ui/webui/media_router/media_router_resources_provider.h " | 27 #include "chrome/browser/ui/webui/media_router/media_router_resources_provider.h " |
28 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h" | 28 #include "chrome/browser/ui/webui/media_router/media_router_webui_message_handle r.h" |
29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
31 #include "content/public/browser/web_ui.h" | 31 #include "content/public/browser/web_ui.h" |
32 #include "content/public/browser/web_ui_data_source.h" | 32 #include "content/public/browser/web_ui_data_source.h" |
33 #include "ui/web_dialogs/web_dialog_delegate.h" | 33 #include "ui/web_dialogs/web_dialog_delegate.h" |
34 | 34 |
35 namespace media_router { | 35 namespace media_router { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 router_(nullptr), | 109 router_(nullptr), |
110 weak_factory_(this) { | 110 weak_factory_(this) { |
111 // Create a WebUIDataSource containing the chrome://media-router page's | 111 // Create a WebUIDataSource containing the chrome://media-router page's |
112 // content. | 112 // content. |
113 scoped_ptr<content::WebUIDataSource> html_source( | 113 scoped_ptr<content::WebUIDataSource> html_source( |
114 content::WebUIDataSource::Create(chrome::kChromeUIMediaRouterHost)); | 114 content::WebUIDataSource::Create(chrome::kChromeUIMediaRouterHost)); |
115 | 115 |
116 content::WebContents* wc = web_ui->GetWebContents(); | 116 content::WebContents* wc = web_ui->GetWebContents(); |
117 DCHECK(wc); | 117 DCHECK(wc); |
118 | 118 |
119 router_ = MediaRouterMojoImplFactory::GetApiForBrowserContext( | 119 router_ = MediaRouterFactory::GetApiForBrowserContext( |
120 wc->GetBrowserContext()); | 120 wc->GetBrowserContext()); |
121 DCHECK(router_); | 121 DCHECK(router_); |
122 | 122 |
123 AddLocalizedStrings(html_source.get()); | 123 AddLocalizedStrings(html_source.get()); |
124 AddMediaRouterUIResources(html_source.get()); | 124 AddMediaRouterUIResources(html_source.get()); |
125 // Ownership of |html_source| is transferred to the BrowserContext. | 125 // Ownership of |html_source| is transferred to the BrowserContext. |
126 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), | 126 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), |
127 html_source.release()); | 127 html_source.release()); |
128 | 128 |
129 // Ownership of |handler_| is transferred to |web_ui|. | 129 // Ownership of |handler_| is transferred to |web_ui|. |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 SessionTabHelper::IdForTab(initiator_), | 344 SessionTabHelper::IdForTab(initiator_), |
345 route_response_callbacks); | 345 route_response_callbacks); |
346 return true; | 346 return true; |
347 } | 347 } |
348 | 348 |
349 std::string MediaRouterUI::GetFrameURLHost() const { | 349 std::string MediaRouterUI::GetFrameURLHost() const { |
350 return GetHostFromURL(frame_url_); | 350 return GetHostFromURL(frame_url_); |
351 } | 351 } |
352 | 352 |
353 } // namespace media_router | 353 } // namespace media_router |
OLD | NEW |