root/chrome/browser/extensions/api/cast_channel/cast_message_util.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


// Copyright 2013 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.

#ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
#define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_

#include <string>

namespace extensions {
namespace api {
namespace cast_channel {

class CastMessage;
class DeviceAuthMessage;
struct MessageInfo;

// Fills |message_proto| from |message| and returns true on success.
bool MessageInfoToCastMessage(const MessageInfo& message,
                              CastMessage* message_proto);

// Fills |message| from |message_proto| and returns true on success.
bool CastMessageToMessageInfo(const CastMessage& message_proto,
                              MessageInfo* message);

// Returns a human readable string for |message_proto|.
std::string CastMessageToString(const CastMessage& message_proto);

// Returns a human readable string for |message|.
std::string AuthMessageToString(const DeviceAuthMessage& message);

// Fills |message_proto| appropriately for an auth challenge request message.
void CreateAuthChallengeMessage(CastMessage* message_proto);

// Returns whether the given message is an auth handshake message.
bool IsAuthMessage(const CastMessage& message);

}  // namespace cast_channel
}  // namespace api
}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_

/* [<][>][^][v][top][bottom][index][help] */