Index: chrome/browser/ui/webui/cast/cast_ui.cc |
diff --git a/chrome/browser/ui/webui/cast/cast_ui.cc b/chrome/browser/ui/webui/cast/cast_ui.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..128e68dcff0a9a94bc1979f54b54bda2d89a982d |
--- /dev/null |
+++ b/chrome/browser/ui/webui/cast/cast_ui.cc |
@@ -0,0 +1,31 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/webui/cast/cast_ui.h" |
+ |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/url_constants.h" |
+#include "content/public/browser/web_ui_data_source.h" |
+#include "grit/browser_resources.h" |
+#include "grit/generated_resources.h" |
+ |
+CastUI::CastUI(content::WebUI* web_ui) |
+ : content::WebUIController(web_ui) { |
+ // Set up the chrome://hello-world source. |
apacible
2016/05/16 19:04:07
chrome://cast
sheretov
2016/05/17 01:59:26
Done :)
|
+ content::WebUIDataSource* html_source = |
+ content::WebUIDataSource::Create(chrome::kChromeUICastHost); |
+ |
+ // Add required resources. |
+ html_source->AddResourcePath("cast.css", IDR_CAST_CSS); |
+ html_source->AddResourcePath("cast.js", IDR_CAST_JS); |
+ html_source->AddResourcePath("cast_favicon.ico", IDR_CAST_FAVICON); |
+ html_source->SetDefaultResource(IDR_CAST_HTML); |
+ html_source->OverrideContentSecurityPolicyObjectSrc("object-src *;"); |
+ |
+ Profile* profile = Profile::FromWebUI(web_ui); |
+ content::WebUIDataSource::Add(profile, html_source); |
+} |
+ |
+CastUI::~CastUI() { |
+} |