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

Side by Side Diff: components/dom_distiller/webui/dom_distiller_ui.cc

Issue 23503042: Initial WebUI for DOM Distiller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added dependency for dom_distiller_resources Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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/dom_distiller/webui/dom_distiller_ui.h"
6
7 #include "components/dom_distiller/core/dom_distiller_constants.h"
8 #include "components/dom_distiller/webui/dom_distiller_handler.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/component_strings.h"
14 #include "grit/dom_distiller_resources.h"
15
16 namespace dom_distiller {
17
18 DomDistillerUI::DomDistillerUI(content::WebUI* web_ui)
19 : content::WebUIController(web_ui) {
20 // Set up WebUIDataSource.
21 content::WebUIDataSource* source =
22 content::WebUIDataSource::Create(kChromeUIDomDistillerHost);
23 source->SetDefaultResource(IDR_ABOUT_DOM_DISTILLER_HTML);
24 source->AddResourcePath("about_dom_distiller.css",
25 IDR_ABOUT_DOM_DISTILLER_CSS);
26 source->AddResourcePath("about_dom_distiller.js",
27 IDR_ABOUT_DOM_DISTILLER_JS);
28
29 source->SetUseJsonJSFormatV2();
30 source->AddLocalizedString("domDistillerTitle", IDS_DOM_DISTILLER_TITLE);
31 content::BrowserContext* browser_context =
32 web_ui->GetWebContents()->GetBrowserContext();
33 content::WebUIDataSource::Add(browser_context, source);
34 source->SetJsonPath("strings.js");
35
36 // Add message handler.
37 web_ui->AddMessageHandler(new DomDistillerHandler());
38 }
39
40 DomDistillerUI::~DomDistillerUI() {}
41
42 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/webui/dom_distiller_ui.h ('k') | components/dom_distiller/webui/resources/about_dom_distiller.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698