Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/webui/cast/cast_ui.h" | |
| 6 | |
| 7 #include "chrome/browser/profiles/profile.h" | |
| 8 #include "chrome/common/url_constants.h" | |
| 9 #include "content/public/browser/web_ui_data_source.h" | |
| 10 #include "grit/browser_resources.h" | |
| 11 #include "grit/generated_resources.h" | |
| 12 | |
| 13 CastUI::CastUI(content::WebUI* web_ui) | |
| 14 : content::WebUIController(web_ui) { | |
| 15 // Set up the chrome://hello-world source. | |
|
apacible
2016/05/16 19:04:07
chrome://cast
sheretov
2016/05/17 01:59:26
Done :)
| |
| 16 content::WebUIDataSource* html_source = | |
| 17 content::WebUIDataSource::Create(chrome::kChromeUICastHost); | |
| 18 | |
| 19 // Add required resources. | |
| 20 html_source->AddResourcePath("cast.css", IDR_CAST_CSS); | |
| 21 html_source->AddResourcePath("cast.js", IDR_CAST_JS); | |
| 22 html_source->AddResourcePath("cast_favicon.ico", IDR_CAST_FAVICON); | |
| 23 html_source->SetDefaultResource(IDR_CAST_HTML); | |
| 24 html_source->OverrideContentSecurityPolicyObjectSrc("object-src *;"); | |
| 25 | |
| 26 Profile* profile = Profile::FromWebUI(web_ui); | |
| 27 content::WebUIDataSource::Add(profile, html_source); | |
| 28 } | |
| 29 | |
| 30 CastUI::~CastUI() { | |
| 31 } | |
| OLD | NEW |