| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "url/gurl.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 14 enum PresentationConnectionState { | 15 enum PresentationConnectionState { |
| 15 PRESENTATION_CONNECTION_STATE_CONNECTING, | 16 PRESENTATION_CONNECTION_STATE_CONNECTING, |
| 16 PRESENTATION_CONNECTION_STATE_CONNECTED, | 17 PRESENTATION_CONNECTION_STATE_CONNECTED, |
| 17 PRESENTATION_CONNECTION_STATE_CLOSED, | 18 PRESENTATION_CONNECTION_STATE_CLOSED, |
| 18 PRESENTATION_CONNECTION_STATE_TERMINATED | 19 PRESENTATION_CONNECTION_STATE_TERMINATED |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 // TODO(imcheng): Use WENT_AWAY for 1-UA mode when it is implemented | 22 // TODO(imcheng): Use WENT_AWAY for 1-UA mode when it is implemented |
| 22 // (crbug.com/513859). | 23 // (crbug.com/513859). |
| 23 enum PresentationConnectionCloseReason { | 24 enum PresentationConnectionCloseReason { |
| 24 PRESENTATION_CONNECTION_CLOSE_REASON_CONNECTION_ERROR, | 25 PRESENTATION_CONNECTION_CLOSE_REASON_CONNECTION_ERROR, |
| 25 PRESENTATION_CONNECTION_CLOSE_REASON_CLOSED, | 26 PRESENTATION_CONNECTION_CLOSE_REASON_CLOSED, |
| 26 PRESENTATION_CONNECTION_CLOSE_REASON_WENT_AWAY | 27 PRESENTATION_CONNECTION_CLOSE_REASON_WENT_AWAY |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 // TODO(imcheng): Rename to PresentationConnectionInfo. | 30 // TODO(imcheng): Rename to PresentationConnectionInfo. |
| 30 // Represents a presentation session that has been established via either | 31 // Represents a presentation session that has been established via either |
| 31 // browser actions or Presentation API. | 32 // browser actions or Presentation API. |
| 32 struct CONTENT_EXPORT PresentationSessionInfo { | 33 struct CONTENT_EXPORT PresentationSessionInfo { |
| 33 PresentationSessionInfo(const std::string& presentation_url, | 34 PresentationSessionInfo(const GURL& presentation_url, |
| 34 const std::string& presentation_id); | 35 const std::string& presentation_id); |
| 35 ~PresentationSessionInfo(); | 36 ~PresentationSessionInfo(); |
| 36 | 37 |
| 37 const std::string presentation_url; | 38 const GURL presentation_url; |
| 38 const std::string presentation_id; | 39 const std::string presentation_id; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 // Possible reasons why an attempt to create a presentation session failed. | 42 // Possible reasons why an attempt to create a presentation session failed. |
| 42 enum PresentationErrorType { | 43 enum PresentationErrorType { |
| 43 PRESENTATION_ERROR_NO_AVAILABLE_SCREENS, | 44 PRESENTATION_ERROR_NO_AVAILABLE_SCREENS, |
| 44 PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED, | 45 PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED, |
| 45 PRESENTATION_ERROR_NO_PRESENTATION_FOUND, | 46 PRESENTATION_ERROR_NO_PRESENTATION_FOUND, |
| 46 PRESENTATION_ERROR_UNKNOWN, | 47 PRESENTATION_ERROR_UNKNOWN, |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 // Struct returned when an attempt to create a presentation session failed. | 50 // Struct returned when an attempt to create a presentation session failed. |
| 50 struct CONTENT_EXPORT PresentationError { | 51 struct CONTENT_EXPORT PresentationError { |
| 51 PresentationError(PresentationErrorType error_type, | 52 PresentationError(PresentationErrorType error_type, |
| 52 const std::string& message); | 53 const std::string& message); |
| 53 ~PresentationError(); | 54 ~PresentationError(); |
| 54 | 55 |
| 55 const PresentationErrorType error_type; | 56 const PresentationErrorType error_type; |
| 56 const std::string message; | 57 const std::string message; |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace content | 60 } // namespace content |
| 60 | 61 |
| 61 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ | 62 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ |
| OLD | NEW |