blob: 9c0c35899208df4c233931d3168f540730336225 [file] [log] [blame]
// 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 <string>
#include "base/string16.h"
#include "build/build_config.h"
#include "cobalt/media/base/media_export.h"
namespace cobalt {
namespace media {
// The media layer can't access Chrome's resource bundle directly. This facility
// allows clients to provide indirect access.
// IDs that will get mapped to corresponding entries with IDS_ prefixes in
// chrome/app/generated_resources.grd.
enum MessageId {
#if defined(OS_WIN)
#if defined(OS_CHROMEOS)
// Implementations are expected to convert MessageIds to generated_resources.grd
// IDs and extract the matching string from Chrome's resource bundle (e.g.
// through l10n_util::GetStringUTF16).
using LocalizedStringProvider = base::string16 (*)(MessageId message_id);
// Initializes the global LocalizedStringProvider function.
MEDIA_EXPORT void SetLocalizedStringProvider(LocalizedStringProvider func);
#if !defined(OS_IOS)
// The LocalizedStringProvider has probably not been initialized on iOS. This
// will give an early compile warning for clients attempting to use it.
// Returns a resource string corresponding to |message_id|. See l10n_util.h.
// Returns an empty string if the LocalizedStringProvider has not been
// initialized or if the ID is unrecognized.
std::string GetLocalizedStringUTF8(MessageId message_id);
base::string16 GetLocalizedStringUTF16(MessageId message_id);
} // namespace media
} // namespace cobalt