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 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 enum PresentationSessionState { | 14 enum PresentationSessionState { |
15 PRESENTATION_SESSION_STATE_CONNECTED, | 15 PRESENTATION_SESSION_STATE_CONNECTED, |
16 PRESENTATION_SESSION_STATE_DISCONNECTED | 16 PRESENTATION_SESSION_STATE_DISCONNECTED |
17 }; | 17 }; |
18 | 18 |
19 // Represents a presentation session that has been established via either | 19 // Represents a presentation session that has been established via either |
20 // browser actions or Presentation API. | 20 // browser actions or Presentation API. |
21 struct CONTENT_EXPORT PresentationSessionInfo { | 21 struct CONTENT_EXPORT PresentationSessionInfo { |
22 PresentationSessionInfo(const std::string& presentation_url, | 22 PresentationSessionInfo(const std::string& presentation_url, |
23 const std::string& presentation_id); | 23 const std::string& presentation_id); |
24 ~PresentationSessionInfo(); | 24 ~PresentationSessionInfo(); |
25 | 25 |
| 26 bool IsController() const { return !presentation_url.empty(); } |
| 27 |
26 const std::string presentation_url; | 28 const std::string presentation_url; |
27 const std::string presentation_id; | 29 const std::string presentation_id; |
28 }; | 30 }; |
29 | 31 |
30 // Possible reasons why an attempt to create a presentation session failed. | 32 // Possible reasons why an attempt to create a presentation session failed. |
31 enum PresentationErrorType { | 33 enum PresentationErrorType { |
32 PRESENTATION_ERROR_NO_AVAILABLE_SCREENS, | 34 PRESENTATION_ERROR_NO_AVAILABLE_SCREENS, |
33 PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED, | 35 PRESENTATION_ERROR_SESSION_REQUEST_CANCELLED, |
34 PRESENTATION_ERROR_NO_PRESENTATION_FOUND, | 36 PRESENTATION_ERROR_NO_PRESENTATION_FOUND, |
35 PRESENTATION_ERROR_UNKNOWN, | 37 PRESENTATION_ERROR_UNKNOWN, |
36 }; | 38 }; |
37 | 39 |
38 // Struct returned when an attempt to create a presentation session failed. | 40 // Struct returned when an attempt to create a presentation session failed. |
39 struct CONTENT_EXPORT PresentationError { | 41 struct CONTENT_EXPORT PresentationError { |
40 PresentationError(PresentationErrorType error_type, | 42 PresentationError(PresentationErrorType error_type, |
41 const std::string& message); | 43 const std::string& message); |
42 ~PresentationError(); | 44 ~PresentationError(); |
43 | 45 |
44 const PresentationErrorType error_type; | 46 const PresentationErrorType error_type; |
45 const std::string message; | 47 const std::string message; |
46 }; | 48 }; |
47 | 49 |
48 } // namespace content | 50 } // namespace content |
49 | 51 |
50 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ | 52 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ |
OLD | NEW |