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 "content/public/browser/web_contents.h" |
| 6 #include "content/public/browser/web_ui_data_source.h" |
| 7 #include "grit/oobe_ui_resources.h" |
| 8 #include "ui/oobe/declarations/oobe_web_ui_view.h" |
| 9 #include "ui/oobe/oobe_ui.h" |
| 10 |
| 11 namespace { |
| 12 |
| 13 void SetUpDataSource(content::WebUIDataSource* source) { |
| 14 source->SetJsonPath("strings.js"); |
| 15 source->AddResourcePath("", IDR_OOBE_UI_HTML); |
| 16 source->AddResourcePath("oobe_ui.js", IDR_OOBE_UI_JS); |
| 17 source->AddResourcePath("oobe-element.html", IDR_OOBE_UI_OOBE_ELEMENT_HTML); |
| 18 source->AddResourcePath("oobe-element.js", IDR_OOBE_UI_OOBE_ELEMENT_JS); |
| 19 } |
| 20 |
| 21 } // namespace |
| 22 |
| 23 OobeMdUI::OobeMdUI(content::WebUI* web_ui, const std::string& host) |
| 24 : WebUIController(web_ui) { |
| 25 content::WebUIDataSource* source = content::WebUIDataSource::Create(host); |
| 26 SetUpDataSource(source); |
| 27 |
| 28 view_.reset(new gen::OobeWebUIView(web_ui)); |
| 29 view_->Init(); |
| 30 view_->SetUpDataSource(source); |
| 31 |
| 32 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), |
| 33 source); |
| 34 } |
| 35 |
| 36 OobeMdUI::~OobeMdUI() { |
| 37 } |
OLD | NEW |