| 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_RENDERER_PRESENTATION_PRESENTATION_SESSION_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_CLIENT_H_ |
| 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_CLIENT_H_ | 6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 10 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nConnectionClient.h" | 12 #include "third_party/WebKit/public/platform/modules/presentation/WebPresentatio
nConnectionClient.h" |
| 11 #include "third_party/WebKit/public/platform/modules/presentation/presentation.m
ojom.h" | 13 #include "third_party/WebKit/public/platform/modules/presentation/presentation.m
ojom.h" |
| 12 #include "url/gurl.h" | 14 |
| 15 class GURL; |
| 13 | 16 |
| 14 namespace content { | 17 namespace content { |
| 15 | 18 |
| 16 // PresentationConnectionClient is passed to the Blink layer if presentation | 19 // PresentationConnectionClient is passed to the Blink layer if presentation |
| 17 // session has been created successfully. Owned by the callback. | 20 // session has been created successfully. Owned by the callback. |
| 18 class CONTENT_EXPORT PresentationConnectionClient | 21 class CONTENT_EXPORT PresentationConnectionClient |
| 19 : public NON_EXPORTED_BASE(blink::WebPresentationConnectionClient) { | 22 : public NON_EXPORTED_BASE(blink::WebPresentationConnectionClient) { |
| 20 public: | 23 public: |
| 21 explicit PresentationConnectionClient( | 24 explicit PresentationConnectionClient( |
| 22 blink::mojom::PresentationSessionInfoPtr session_info); | 25 blink::mojom::PresentationSessionInfoPtr session_info); |
| 23 explicit PresentationConnectionClient(const GURL& url, | 26 |
| 24 const mojo::String& id); | 27 // Creates a PresentationConnectionClient for a 1-UA presentation. |
| 28 // |session_info|: contains presentation ID and URL info |
| 29 // |proxy|: Proxy to blink PresentationConnection object in current render |
| 30 // process. Ownership is passed to this class. |
| 31 PresentationConnectionClient( |
| 32 const GURL& url, |
| 33 const mojo::String& id, |
| 34 std::unique_ptr<blink::WebPresentationConnectionProxy> proxy); |
| 25 ~PresentationConnectionClient() override; | 35 ~PresentationConnectionClient() override; |
| 26 | 36 |
| 27 // WebPresentationConnectionClient implementation. | 37 // WebPresentationConnectionClient implementation. |
| 28 blink::WebURL getUrl() override; | 38 blink::WebURL getUrl() override; |
| 29 blink::WebString getId() override; | 39 blink::WebString getId() override; |
| 30 | 40 |
| 41 // Returns proxy passed into this class. Transfers ownership of returned proxy |
| 42 // to caller. |
| 43 std::unique_ptr<blink::WebPresentationConnectionProxy> takeProxy() override; |
| 44 |
| 31 private: | 45 private: |
| 32 blink::WebURL url_; | 46 blink::WebURL url_; |
| 33 blink::WebString id_; | 47 blink::WebString id_; |
| 48 std::unique_ptr<blink::WebPresentationConnectionProxy> proxy_; |
| 34 }; | 49 }; |
| 35 | 50 |
| 36 } // namespace content | 51 } // namespace content |
| 37 | 52 |
| 38 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_CLIENT_H_ | 53 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_CLIENT_H_ |
| OLD | NEW |