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

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

Issue 1102683002: Revert of [Presentation API] Implement ondefaultsessionstart in PSImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « content/public/browser/presentation_service_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_dispatcher.h" 5 #include "content/renderer/presentation/presentation_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/presentation/presentation_service.mojom.h" 8 #include "content/common/presentation/presentation_service.mojom.h"
9 #include "content/public/common/service_registry.h" 9 #include "content/public/common/service_registry.h"
10 #include "content/public/renderer/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 void PresentationDispatcher::OnDefaultSessionStarted( 165 void PresentationDispatcher::OnDefaultSessionStarted(
166 presentation::PresentationSessionInfoPtr session_info) { 166 presentation::PresentationSessionInfoPtr session_info) {
167 if (!controller_) 167 if (!controller_)
168 return; 168 return;
169 169
170 // Reset the callback to get the next event. 170 // Reset the callback to get the next event.
171 presentation_service_->ListenForDefaultSessionStart(base::Bind( 171 presentation_service_->ListenForDefaultSessionStart(base::Bind(
172 &PresentationDispatcher::OnDefaultSessionStarted, 172 &PresentationDispatcher::OnDefaultSessionStarted,
173 base::Unretained(this))); 173 base::Unretained(this)));
174 174
175 if (!session_info.is_null()) { 175 DCHECK(!session_info.is_null());
176 controller_->didStartDefaultSession( 176 controller_->didStartDefaultSession(
177 new PresentationSessionClient(session_info.Pass())); 177 new PresentationSessionClient(session_info.Pass()));
178 }
179 } 178 }
180 179
181 void PresentationDispatcher::OnSessionCreated( 180 void PresentationDispatcher::OnSessionCreated(
182 blink::WebPresentationSessionClientCallbacks* callback, 181 blink::WebPresentationSessionClientCallbacks* callback,
183 presentation::PresentationSessionInfoPtr session_info, 182 presentation::PresentationSessionInfoPtr session_info,
184 presentation::PresentationErrorPtr error) { 183 presentation::PresentationErrorPtr error) {
185 DCHECK(callback); 184 DCHECK(callback);
186 if (!error.is_null()) { 185 if (!error.is_null()) {
187 DCHECK(session_info.is_null()); 186 DCHECK(session_info.is_null());
188 callback->onError(new blink::WebPresentationError( 187 callback->onError(new blink::WebPresentationError(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 presentation_service_->ListenForDefaultSessionStart(base::Bind( 222 presentation_service_->ListenForDefaultSessionStart(base::Bind(
224 &PresentationDispatcher::OnDefaultSessionStarted, 223 &PresentationDispatcher::OnDefaultSessionStarted,
225 base::Unretained(this))); 224 base::Unretained(this)));
226 presentation_service_->ListenForSessionStateChange(base::Bind( 225 presentation_service_->ListenForSessionStateChange(base::Bind(
227 &PresentationDispatcher::OnSessionStateChange, 226 &PresentationDispatcher::OnSessionStateChange,
228 base::Unretained(this))); 227 base::Unretained(this)));
229 */ 228 */
230 } 229 }
231 230
232 } // namespace content 231 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/presentation_service_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698