OLD | NEW |
---|---|
(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 const GURL& url) | |
Evan Stade
2013/09/13 21:07:05
regardless of whether you end up passing it via th
nyquist
2013/09/13 21:40:27
I'll remove this for now.
nyquist
2013/09/13 22:21:04
Done.
| |
20 : content::WebUIController(web_ui) { | |
21 // Set up WebUIDataSource. | |
22 content::WebUIDataSource* source = | |
23 content::WebUIDataSource::Create(kChromeUIDomDistillerHost); | |
24 source->SetDefaultResource(IDR_ABOUT_DOM_DISTILLER_HTML); | |
25 source->AddResourcePath("about_dom_distiller.css", | |
26 IDR_ABOUT_DOM_DISTILLER_CSS); | |
27 source->AddResourcePath("about_dom_distiller.js", | |
28 IDR_ABOUT_DOM_DISTILLER_JS); | |
29 | |
30 source->SetUseJsonJSFormatV2(); | |
31 source->AddLocalizedString("domDistillerTitle", IDS_DOM_DISTILLER_TITLE); | |
32 content::BrowserContext* browser_context = | |
33 web_ui->GetWebContents()->GetBrowserContext(); | |
34 content::WebUIDataSource::Add(browser_context, source); | |
35 source->SetJsonPath("strings.js"); | |
36 | |
37 // Add message handler. | |
38 web_ui->AddMessageHandler(new DomDistillerHandler()); | |
39 } | |
40 | |
41 DomDistillerUI::~DomDistillerUI() {} | |
42 | |
43 } // namespace dom_distiller | |
OLD | NEW |