Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: ui/oobe/oobe_md_ui.cc

Issue 1181703008: Removed webui_generator and new OOBE UI placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed empty line. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/oobe/oobe_md_ui.h ('k') | ui/oobe/oobe_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 "base/strings/string_util.h"
6 #include "content/public/browser/web_contents.h"
7 #include "content/public/browser/web_ui_data_source.h"
8 #include "grit/oobe_resources.h"
9 #include "grit/oobe_resources_map.h"
10 #include "ui/oobe/declarations/oobe_web_ui_view.h"
11 #include "ui/oobe/oobe_md_ui.h"
12
13 namespace {
14
15 void SetUpDataSource(content::WebUIDataSource* source) {
16 source->SetJsonPath("strings.js");
17 source->AddResourcePath("", IDR_OOBE_UI_HTML);
18
19 // Add all resources defined in "oobe_resources.grd" file at once.
20 const char prefix[] = "resources/";
21 const size_t prefix_length = arraysize(prefix) - 1;
22 for (size_t i = 0; i < kOobeResourcesSize; ++i) {
23 std::string name = kOobeResources[i].name;
24 DCHECK(base::StartsWithASCII(name, prefix, true));
25 source->AddResourcePath(name.substr(prefix_length),
26 kOobeResources[i].value);
27 }
28 }
29
30 } // namespace
31
32 OobeMdUI::OobeMdUI(content::WebUI* web_ui, const std::string& host)
33 : WebUIController(web_ui) {
34 content::WebUIDataSource* source = content::WebUIDataSource::Create(host);
35 SetUpDataSource(source);
36
37 view_.reset(new gen::OobeWebUIView(web_ui));
38 view_->Init();
39 view_->SetUpDataSource(source);
40
41 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
42 source);
43 }
44
45 OobeMdUI::~OobeMdUI() {}
OLDNEW
« no previous file with comments | « ui/oobe/oobe_md_ui.h ('k') | ui/oobe/oobe_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698