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 "components/proximity_auth/webui/proximity_auth_ui.h" | 5 #include "components/proximity_auth/webui/proximity_auth_ui.h" |
6 | 6 |
7 #include "components/proximity_auth/webui/proximity_auth_webui_handler.h" | 7 #include "components/proximity_auth/webui/proximity_auth_webui_handler.h" |
8 #include "components/proximity_auth/webui/url_constants.h" | 8 #include "components/proximity_auth/webui/url_constants.h" |
9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "content/public/browser/web_ui.h" | 11 #include "content/public/browser/web_ui.h" |
12 #include "content/public/browser/web_ui_data_source.h" | 12 #include "content/public/browser/web_ui_data_source.h" |
13 #include "grit/components_resources.h" | 13 #include "grit/components_resources.h" |
| 14 #include "grit/webui_resources.h" |
14 | 15 |
15 namespace proximity_auth { | 16 namespace proximity_auth { |
16 | 17 |
17 ProximityAuthUI::ProximityAuthUI(content::WebUI* web_ui) | 18 ProximityAuthUI::ProximityAuthUI(content::WebUI* web_ui) |
18 : content::WebUIController(web_ui) { | 19 : content::WebUIController(web_ui) { |
19 content::WebUIDataSource* source = | 20 content::WebUIDataSource* source = |
20 content::WebUIDataSource::Create(kChromeUIProximityAuthHost); | 21 content::WebUIDataSource::Create(kChromeUIProximityAuthHost); |
21 source->SetDefaultResource(IDR_PROXIMITY_AUTH_HTML); | 22 source->SetDefaultResource(IDR_PROXIMITY_AUTH_UI_HTML); |
22 source->AddResourcePath("proximity_auth.css", IDR_PROXIMITY_AUTH_CSS); | 23 source->AddResourcePath("proximity_auth.css", IDR_PROXIMITY_AUTH_UI_CSS); |
23 source->AddResourcePath("proximity_auth.js", IDR_PROXIMITY_AUTH_JS); | 24 source->AddResourcePath("content-panel.html", |
24 source->SetJsonPath("strings.js"); | 25 IDR_PROXIMITY_AUTH_CONTENT_PANEL_HTML); |
| 26 source->AddResourcePath("content-panel.js", |
| 27 IDR_PROXIMITY_AUTH_CONTENT_PANEL_JS); |
| 28 source->AddResourcePath("log-panel.html", IDR_PROXIMITY_AUTH_LOG_PANEL_HTML); |
| 29 source->AddResourcePath("log-panel.js", IDR_PROXIMITY_AUTH_LOG_PANEL_JS); |
| 30 source->AddResourcePath("local-state.html", |
| 31 IDR_PROXIMITY_AUTH_LOCAL_STATE_HTML); |
| 32 source->AddResourcePath("local-state.js", IDR_PROXIMITY_AUTH_LOCAL_STATE_JS); |
| 33 source->AddResourcePath("device-list.html", |
| 34 IDR_PROXIMITY_AUTH_DEVICE_LIST_HTML); |
| 35 source->AddResourcePath("device-list.js", IDR_PROXIMITY_AUTH_DEVICE_LIST_JS); |
25 | 36 |
26 content::BrowserContext* browser_context = | 37 content::BrowserContext* browser_context = |
27 web_ui->GetWebContents()->GetBrowserContext(); | 38 web_ui->GetWebContents()->GetBrowserContext(); |
28 content::WebUIDataSource::Add(browser_context, source); | 39 content::WebUIDataSource::Add(browser_context, source); |
29 web_ui->AddMessageHandler(new ProximityAuthWebUIHandler()); | 40 web_ui->AddMessageHandler(new ProximityAuthWebUIHandler()); |
30 } | 41 } |
31 | 42 |
32 ProximityAuthUI::~ProximityAuthUI() { | 43 ProximityAuthUI::~ProximityAuthUI() { |
33 } | 44 } |
34 | 45 |
35 } // namespace proximity_auth | 46 } // namespace proximity_auth |
OLD | NEW |