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

Unified Diff: media/base/media_resources.cc

Issue 1362093002: Re-land: Add localized default audio device names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude media_resource_provider on iOS. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/media_resources.h ('k') | media/base/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_resources.cc
diff --git a/media/base/media_resources.cc b/media/base/media_resources.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d7259e91477d2d4bbae1862aa6eaa11192dbe483
--- /dev/null
+++ b/media/base/media_resources.cc
@@ -0,0 +1,29 @@
+// 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 "media/base/media_resources.h"
+
+#include "base/logging.h"
+#include "base/strings/utf_string_conversions.h"
+
+namespace media {
+
+static LocalizedStringProvider g_localized_string_provider = nullptr;
+
+void SetLocalizedStringProvider(LocalizedStringProvider func) {
+ g_localized_string_provider = func;
+}
+
+#if !defined(OS_IOS)
+std::string GetLocalizedStringUTF8(MessageId message_id) {
+ return base::UTF16ToUTF8(GetLocalizedStringUTF16(message_id));
+}
+
+base::string16 GetLocalizedStringUTF16(MessageId message_id) {
+ return g_localized_string_provider ? g_localized_string_provider(message_id)
+ : base::string16();
+}
+#endif
+
+} // namespace media
« no previous file with comments | « media/base/media_resources.h ('k') | media/base/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698