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 |