Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / extensions / browser / api / cast_channel / cast_message_util.h
blobb14b737a5c93b99398e28bea74be27f87919e637
1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
8 #include <string>
10 namespace extensions {
11 namespace api {
12 namespace cast_channel {
14 class CastMessage;
15 class DeviceAuthMessage;
16 struct MessageInfo;
18 // Fills |message_proto| from |message| and returns true on success.
19 bool MessageInfoToCastMessage(const MessageInfo& message,
20 CastMessage* message_proto);
22 // Checks if the contents of |message_proto| are valid.
23 bool IsCastMessageValid(const CastMessage& message_proto);
25 // Fills |message| from |message_proto| and returns true on success.
26 bool CastMessageToMessageInfo(const CastMessage& message_proto,
27 MessageInfo* message);
29 // Returns a human readable string for |message_proto|.
30 std::string CastMessageToString(const CastMessage& message_proto);
32 // Returns a human readable string for |message|.
33 std::string AuthMessageToString(const DeviceAuthMessage& message);
35 // Fills |message_proto| appropriately for an auth challenge request message.
36 void CreateAuthChallengeMessage(CastMessage* message_proto);
38 // Returns whether the given message is an auth handshake message.
39 bool IsAuthMessage(const CastMessage& message);
41 } // namespace cast_channel
42 } // namespace api
43 } // namespace extensions
45 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_