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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/media_router/media_router_resources_provider.h"
7 #include "content/public/browser/web_ui_data_source.h"
8 #include "grit/browser_resources.h"
12 void AddIcons(content::WebUIDataSource
* html_source
) {
13 html_source
->AddResourcePath("elements/icon/sad-face.png",
15 html_source
->AddResourcePath("elements/icon/sad-face2x.png",
16 IDR_SAD_FACE_2X_ICON
);
19 void AddMainWebResources(content::WebUIDataSource
* html_source
) {
20 html_source
->AddResourcePath("media_router.js", IDR_MEDIA_ROUTER_JS
);
21 html_source
->AddResourcePath("media_router_common.css",
22 IDR_MEDIA_ROUTER_COMMON_CSS
);
23 html_source
->AddResourcePath("media_router.css",
24 IDR_MEDIA_ROUTER_CSS
);
25 html_source
->AddResourcePath("media_router_data.js",
26 IDR_MEDIA_ROUTER_DATA_JS
);
27 html_source
->AddResourcePath("media_router_ui_interface.js",
28 IDR_MEDIA_ROUTER_UI_INTERFACE_JS
);
29 html_source
->AddResourcePath("polymer_config.js",
30 IDR_MEDIA_ROUTER_POLYMER_CONFIG_JS
);
33 void AddPolymerElements(content::WebUIDataSource
* html_source
) {
34 html_source
->AddResourcePath(
35 "elements/issue_banner/issue_banner.css",
36 IDR_ISSUE_BANNER_CSS
);
37 html_source
->AddResourcePath(
38 "elements/issue_banner/issue_banner.html",
39 IDR_ISSUE_BANNER_HTML
);
40 html_source
->AddResourcePath(
41 "elements/issue_banner/issue_banner.js",
43 html_source
->AddResourcePath(
44 "elements/media_router_container/media_router_container.css",
45 IDR_MEDIA_ROUTER_CONTAINER_CSS
);
46 html_source
->AddResourcePath(
47 "elements/media_router_container/media_router_container.html",
48 IDR_MEDIA_ROUTER_CONTAINER_HTML
);
49 html_source
->AddResourcePath(
50 "elements/media_router_container/media_router_container.js",
51 IDR_MEDIA_ROUTER_CONTAINER_JS
);
52 html_source
->AddResourcePath(
53 "elements/route_details/route_details.css",
54 IDR_ROUTE_DETAILS_CSS
);
55 html_source
->AddResourcePath(
56 "elements/route_details/route_details.html",
57 IDR_ROUTE_DETAILS_HTML
);
58 html_source
->AddResourcePath(
59 "elements/route_details/route_details.js",
60 IDR_ROUTE_DETAILS_JS
);
65 namespace media_router
{
67 void AddMediaRouterUIResources(content::WebUIDataSource
* html_source
) {
68 AddIcons(html_source
);
69 AddMainWebResources(html_source
);
70 AddPolymerElements(html_source
);
71 html_source
->SetDefaultResource(IDR_MEDIA_ROUTER_HTML
);
74 } // namespace media_router