From 2b3813135ccbfc0e725b842a33d17b0c785941eb Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Thu, 7 Apr 2016 16:25:30 +0530 Subject: [PATCH] register localized media strings --- brightray/browser/browser_main_parts.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 279eff9b818..888a1c52956 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -11,9 +11,11 @@ #include "base/command_line.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/utf_string_conversions.h" #include "components/devtools_http_handler/devtools_http_handler.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_switches.h" +#include "media/base/media_resources.h" #include "net/proxy/proxy_resolver_v8.h" #include "ui/base/l10n/l10n_util.h" @@ -129,6 +131,19 @@ int X11EmptyIOErrorHandler(Display* d) { } #endif +base::string16 MediaStringProvider(media::MessageId id) { + switch (id) { + case media::DEFAULT_AUDIO_DEVICE_NAME: + return base::ASCIIToUTF16("Default"); +#if defined(OS_WIN) + case media::COMMUNICATIONS_AUDIO_DEVICE_NAME: + return base::ASCIIToUTF16("Communications"); +#endif + default: + return base::string16(); + } +} + } // namespace BrowserMainParts::BrowserMainParts() { @@ -177,6 +192,7 @@ void BrowserMainParts::PreMainMessageLoopStart() { #if defined(OS_MACOSX) InitializeMainNib(); #endif + media::SetLocalizedStringProvider(MediaStringProvider); } void BrowserMainParts::PreMainMessageLoopRun() {