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

Unified Diff: chrome/browser/ui/webui/media_router/media_router_localized_strings_provider.cc

Issue 1056023003: Add localized string and resource paths for media router WebUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
Index: chrome/browser/ui/webui/media_router/media_router_localized_strings_provider.cc
diff --git a/chrome/browser/ui/webui/media_router/media_router_localized_strings_provider.cc b/chrome/browser/ui/webui/media_router/media_router_localized_strings_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9681e3388ead1f5712ebf65edcfb0a981f14a4d2
--- /dev/null
+++ b/chrome/browser/ui/webui/media_router/media_router_localized_strings_provider.cc
@@ -0,0 +1,39 @@
+// Copyright 2015 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/media_router/media_router_localized_strings_provider.h"
+
+#include "chrome/grit/generated_resources.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+namespace {
+
+// Note that media_router.html contains a <script> tag which imports a script
+// of the following name. These names must be kept in sync.
+const char kLocalizedStringsFile[] = "strings.js";
+
+void AddMediaRouterStrings(content::WebUIDataSource* html_source) {
+ html_source->AddLocalizedString("mediaRouterTitle", IDS_MEDIA_ROUTER_TITLE);
+}
+
+void AddRouteDetailsStrings(content::WebUIDataSource* html_source) {
+ html_source->AddLocalizedString("castingActivityStatus",
+ IDS_MEDIA_ROUTER_CASTING_ACTIVITY_STATUS);
+ html_source->AddLocalizedString("backToSinkPicker",
+ IDS_MEDIA_ROUTER_BACK_TO_SINK_PICKER);
+ html_source->AddLocalizedString("stopCastingButton",
+ IDS_MEDIA_ROUTER_STOP_CASTING_BUTTON);
+}
+
+} // namespace
+
+namespace media_router {
+
+void AddLocalizedStrings(content::WebUIDataSource* html_source) {
+ AddMediaRouterStrings(html_source);
+ AddRouteDetailsStrings(html_source);
+ html_source->SetJsonPath(kLocalizedStringsFile);
+}
+
+} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698