OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "components/proximity_auth/webui/proximity_auth_ui.h" |
| 6 |
| 7 #include "components/proximity_auth/webui/proximity_auth_webui_handler.h" |
| 8 #include "components/proximity_auth/webui/url_constants.h" |
| 9 #include "content/public/browser/browser_context.h" |
| 10 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/browser/web_ui.h" |
| 12 #include "content/public/browser/web_ui_data_source.h" |
| 13 #include "grit/components_resources.h" |
| 14 |
| 15 namespace proximity_auth { |
| 16 |
| 17 ProximityAuthUI::ProximityAuthUI(content::WebUI* web_ui) |
| 18 : content::WebUIController(web_ui) { |
| 19 content::WebUIDataSource* source = |
| 20 content::WebUIDataSource::Create(kChromeUIProximityAuthHost); |
| 21 source->SetDefaultResource(IDR_PROXIMITY_AUTH_HTML); |
| 22 source->AddResourcePath("proximity_auth.css", IDR_PROXIMITY_AUTH_CSS); |
| 23 source->AddResourcePath("proximity_auth.js", IDR_PROXIMITY_AUTH_JS); |
| 24 source->SetJsonPath("strings.js"); |
| 25 |
| 26 content::BrowserContext* browser_context = |
| 27 web_ui->GetWebContents()->GetBrowserContext(); |
| 28 content::WebUIDataSource::Add(browser_context, source); |
| 29 web_ui->AddMessageHandler(new ProximityAuthWebUIHandler()); |
| 30 } |
| 31 |
| 32 ProximityAuthUI::~ProximityAuthUI() { |
| 33 } |
| 34 |
| 35 } // namespace proximity_auth |
OLD | NEW |