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

Unified Diff: chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc

Issue 13842010: Added chrome://translate-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix for Windows (SendMessage could be replaced with SendMessageW) Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/translate_internals/translate_internals_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc
diff --git a/chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc b/chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ca7ffde34176d939fb5529b8161b9dc2d8f980f0
--- /dev/null
+++ b/chrome/browser/ui/webui/translate_internals/translate_internals_ui.cc
@@ -0,0 +1,41 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h"
+
+#include <string>
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/translate_internals/translate_internals_handler.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "grit/browser_resources.h"
+#include "grit/translate_internals_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/resource/resource_bundle.h"
+
+using content::WebContents;
+
+namespace {
+
+content::WebUIDataSource* CreateTranslateInternalsHTMLSource() {
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUITranslateInternalsHost);
+ source->SetDefaultResource(IDR_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_HTML);
+ source->AddResourcePath("translate_internals.js",
+ IDR_TRANSLATE_INTERNALS_TRANSLATE_INTERNALS_JS);
+ return source;
+}
+
+} // namespace
+
+TranslateInternalsUI::TranslateInternalsUI(content::WebUI* web_ui)
+ : WebUIController(web_ui) {
+ web_ui->AddMessageHandler(new TranslateInternalsHandler);
+
+ Profile* profile = Profile::FromWebUI(web_ui);
+ content::WebUIDataSource::Add(profile, CreateTranslateInternalsHTMLSource());
+}
« no previous file with comments | « chrome/browser/ui/webui/translate_internals/translate_internals_ui.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698