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

Unified Diff: components/dom_distiller/webui/dom_distiller_ui.cc

Issue 105623002: Debug UI for DOM distiller supports distillation and lists articles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix strings and dependencies for ios Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/webui/dom_distiller_ui.cc
diff --git a/components/dom_distiller/webui/dom_distiller_ui.cc b/components/dom_distiller/webui/dom_distiller_ui.cc
index e1418434cc43ae7aee933c4b6651a4a029920691..807a6b37f72ffa8450ef06cb94b996ca3b37638b 100644
--- a/components/dom_distiller/webui/dom_distiller_ui.cc
+++ b/components/dom_distiller/webui/dom_distiller_ui.cc
@@ -5,6 +5,7 @@
#include "components/dom_distiller/webui/dom_distiller_ui.h"
#include "components/dom_distiller/core/dom_distiller_constants.h"
+#include "components/dom_distiller/core/dom_distiller_service.h"
#include "components/dom_distiller/webui/dom_distiller_handler.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/web_contents.h"
@@ -15,7 +16,9 @@
namespace dom_distiller {
-DomDistillerUI::DomDistillerUI(content::WebUI* web_ui)
+DomDistillerUi::DomDistillerUi(content::WebUI* web_ui,
+ DomDistillerService* service,
+ const std::string& scheme)
: content::WebUIController(web_ui) {
// Set up WebUIDataSource.
content::WebUIDataSource* source =
@@ -27,16 +30,28 @@ DomDistillerUI::DomDistillerUI(content::WebUI* web_ui)
IDR_ABOUT_DOM_DISTILLER_JS);
source->SetUseJsonJSFormatV2();
- source->AddLocalizedString("domDistillerTitle", IDS_DOM_DISTILLER_TITLE);
+ source->AddLocalizedString("domDistillerTitle",
+ IDS_DOM_DISTILLER_WEBUI_TITLE);
+ source->AddLocalizedString("addArticleUrl",
+ IDS_DOM_DISTILLER_WEBUI_ENTRY_URL);
+ source->AddLocalizedString("addArticleAddButtonLabel",
+ IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD);
+ source->AddLocalizedString("addArticleFailedLabel",
+ IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD_FAILED);
+ source->AddLocalizedString("loadingEntries",
+ IDS_DOM_DISTILLER_WEBUI_FETCHING_ENTRIES);
+ source->AddLocalizedString("refreshButtonLabel",
+ IDS_DOM_DISTILLER_WEBUI_REFRESH);
+
content::BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
content::WebUIDataSource::Add(browser_context, source);
source->SetJsonPath("strings.js");
// Add message handler.
- web_ui->AddMessageHandler(new DomDistillerHandler());
+ web_ui->AddMessageHandler(new DomDistillerHandler(service, scheme));
}
-DomDistillerUI::~DomDistillerUI() {}
+DomDistillerUi::~DomDistillerUi() {}
} // namespace dom_distiller
« 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