Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: content/renderer/presentation/presentation_connection_client.cc

Issue 2379703002: [Presentation API] (alternative) 1-UA: send message between controller and receiver page (Closed)
Patch Set: resolve code review comments from Mark Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "content/renderer/presentation/presentation_connection_client.h" 5 #include "content/renderer/presentation/presentation_connection_client.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/WebString.h" 8 #include "third_party/WebKit/public/platform/WebString.h"
9 #include "third_party/WebKit/public/platform/WebURL.h" 9 #include "third_party/WebKit/public/platform/WebURL.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 PresentationConnectionClient::PresentationConnectionClient( 13 PresentationConnectionClient::PresentationConnectionClient(
14 blink::mojom::PresentationSessionInfoPtr session_info) 14 blink::mojom::PresentationSessionInfoPtr session_info)
15 : url_(session_info->url), 15 : url_(session_info->url),
16 id_(blink::WebString::fromUTF8(session_info->id)) {} 16 id_(blink::WebString::fromUTF8(session_info->id)) {}
17 17
18 PresentationConnectionClient::PresentationConnectionClient( 18 PresentationConnectionClient::PresentationConnectionClient(
19 const GURL& url, 19 const GURL& url,
20 const mojo::String& id) 20 const mojo::String& id)
21 : url_(url), 21 : url_(url),
22 id_(blink::WebString::fromUTF8(id)) {} 22 id_(blink::WebString::fromUTF8(id)) {}
23 23
24 PresentationConnectionClient::PresentationConnectionClient(
25 blink::mojom::PresentationSessionInfoPtr session_info,
26 blink::WebPresentationConnectionProxy* proxy)
27 : url_(session_info->url),
28 id_(blink::WebString::fromUTF8(session_info->id)),
29 proxy_(proxy) {}
30
24 PresentationConnectionClient::~PresentationConnectionClient() { 31 PresentationConnectionClient::~PresentationConnectionClient() {
25 } 32 }
26 33
27 blink::WebURL PresentationConnectionClient::getUrl() { 34 blink::WebURL PresentationConnectionClient::getUrl() {
28 return url_; 35 return url_;
29 } 36 }
30 37
31 blink::WebString PresentationConnectionClient::getId() { 38 blink::WebString PresentationConnectionClient::getId() {
32 return id_; 39 return id_;
33 } 40 }
34 41
42 blink::WebPresentationConnectionProxy*
43 PresentationConnectionClient::getOrCreateProxy() {
44 if (!proxy_)
45 proxy_ = new RendererPresentationConnection();
46 return proxy_;
47 }
48
35 } // namespace content 49 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698