1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
10 namespace extensions
{
12 namespace cast_channel
{
15 class DeviceAuthMessage
;
18 // Fills |message_proto| from |message| and returns true on success.
19 bool MessageInfoToCastMessage(const MessageInfo
& message
,
20 CastMessage
* message_proto
);
22 // Fills |message| from |message_proto| and returns true on success.
23 bool CastMessageToMessageInfo(const CastMessage
& message_proto
,
24 MessageInfo
* message
);
26 // Returns a human readable string for |message_proto|.
27 std::string
CastMessageToString(const CastMessage
& message_proto
);
29 // Returns a human readable string for |message|.
30 std::string
AuthMessageToString(const DeviceAuthMessage
& message
);
32 // Fills |message_proto| appropriately for an auth challenge request message.
33 void CreateAuthChallengeMessage(CastMessage
* message_proto
);
35 // Returns whether the given message is an auth handshake message.
36 bool IsAuthMessage(const CastMessage
& message
);
38 } // namespace cast_channel
40 } // namespace extensions
42 #endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_