| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 content::WebContents* wc = web_ui->GetWebContents(); | 177 content::WebContents* wc = web_ui->GetWebContents(); |
| 178 DCHECK(wc); | 178 DCHECK(wc); |
| 179 | 179 |
| 180 router_ = | 180 router_ = |
| 181 MediaRouterFactory::GetApiForBrowserContext(wc->GetBrowserContext()); | 181 MediaRouterFactory::GetApiForBrowserContext(wc->GetBrowserContext()); |
| 182 | 182 |
| 183 // Allows UI to load extensionview. | 183 // Allows UI to load extensionview. |
| 184 // TODO(haibinlu): limit object-src to current extension once crbug/514866 | 184 // TODO(haibinlu): limit object-src to current extension once crbug/514866 |
| 185 // is fixed. | 185 // is fixed. |
| 186 html_source->OverrideContentSecurityPolicyObjectSrc("object-src *;"); | 186 html_source->OverrideContentSecurityPolicyObjectSrc("object-src chrome:;"); |
| 187 | 187 |
| 188 AddLocalizedStrings(html_source.get()); | 188 AddLocalizedStrings(html_source.get()); |
| 189 AddMediaRouterUIResources(html_source.get()); | 189 AddMediaRouterUIResources(html_source.get()); |
| 190 // Ownership of |html_source| is transferred to the BrowserContext. | 190 // Ownership of |html_source| is transferred to the BrowserContext. |
| 191 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), | 191 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), |
| 192 html_source.release()); | 192 html_source.release()); |
| 193 | 193 |
| 194 // Ownership of |handler_| is transferred to |web_ui|. | 194 // Ownership of |handler_| is transferred to |web_ui|. |
| 195 web_ui->AddMessageHandler(handler_); | 195 web_ui->AddMessageHandler(handler_); |
| 196 } | 196 } |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 base::Time::Now() - start_time_); | 698 base::Time::Now() - start_time_); |
| 699 start_time_ = base::Time(); | 699 start_time_ = base::Time(); |
| 700 } | 700 } |
| 701 } | 701 } |
| 702 | 702 |
| 703 void MediaRouterUI::UpdateMaxDialogHeight(int height) { | 703 void MediaRouterUI::UpdateMaxDialogHeight(int height) { |
| 704 handler_->UpdateMaxDialogHeight(height); | 704 handler_->UpdateMaxDialogHeight(height); |
| 705 } | 705 } |
| 706 | 706 |
| 707 } // namespace media_router | 707 } // namespace media_router |
| OLD | NEW |