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

Unified Diff: chrome/common/media/media_resource_provider.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 | « chrome/common/media/media_resource_provider.h ('k') | chrome/renderer/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/media/media_resource_provider.cc
diff --git a/chrome/common/media/media_resource_provider.cc b/chrome/common/media/media_resource_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cc00bf56355e80bbf9be6219f10ce9bededabd1b
--- /dev/null
+++ b/chrome/common/media/media_resource_provider.cc
@@ -0,0 +1,36 @@
+// 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 "base/logging.h"
+#include "chrome/common/media/media_resource_provider.h"
+#include "chrome/grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace chrome_common_media {
+
+int MediaMessageIdToGrdId(media::MessageId message_id) {
+ switch (message_id) {
+ case media::DEFAULT_AUDIO_DEVICE_NAME:
+ return IDS_DEFAULT_AUDIO_DEVICE_NAME;
+#if defined(OS_WIN)
+ case media::COMMUNICATIONS_AUDIO_DEVICE_NAME:
+ return IDS_COMMUNICATIONS_AUDIO_DEVICE_NAME;
+#endif
+#if defined(OS_CHROMEOS)
+ case media::BEAMFORMING_ON_DEFAULT_AUDIO_INPUT_DEVICE_NAME:
+ return IDS_BEAMFORMING_ON_DEFAULT_AUDIO_INPUT_DEVICE_NAME;
+ case media::BEAMFORMING_OFF_DEFAULT_AUDIO_INPUT_DEVICE_NAME:
+ return IDS_BEAMFORMING_OFF_DEFAULT_AUDIO_INPUT_DEVICE_NAME;
+#endif
+ default:
+ NOTREACHED();
+ return 0;
+ }
+}
+
+base::string16 LocalizedStringProvider(media::MessageId message_id) {
+ return l10n_util::GetStringUTF16(MediaMessageIdToGrdId(message_id));
+}
+
+} // namespace chrome_common_media
« no previous file with comments | « chrome/common/media/media_resource_provider.h ('k') | chrome/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698