| 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 #include "content/renderer/presentation/presentation_dispatcher.h" | 5 #include "content/renderer/presentation/presentation_dispatcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 382 } |
| 383 | 383 |
| 384 void PresentationDispatcher::setReceiver( | 384 void PresentationDispatcher::setReceiver( |
| 385 blink::WebPresentationReceiver* receiver) { | 385 blink::WebPresentationReceiver* receiver) { |
| 386 ConnectToPresentationServiceIfNeeded(); | 386 ConnectToPresentationServiceIfNeeded(); |
| 387 receiver_ = receiver; | 387 receiver_ = receiver; |
| 388 } | 388 } |
| 389 | 389 |
| 390 void PresentationDispatcher::DidCommitProvisionalLoad( | 390 void PresentationDispatcher::DidCommitProvisionalLoad( |
| 391 bool is_new_navigation, | 391 bool is_new_navigation, |
| 392 bool is_same_page_navigation) { | 392 bool is_same_document_navigation) { |
| 393 blink::WebFrame* frame = render_frame()->GetWebFrame(); | 393 blink::WebFrame* frame = render_frame()->GetWebFrame(); |
| 394 // If not top-level navigation. | 394 // If not top-level navigation. |
| 395 if (frame->parent() || is_same_page_navigation) | 395 if (frame->parent() || is_same_document_navigation) |
| 396 return; | 396 return; |
| 397 | 397 |
| 398 // Remove all pending send message requests. | 398 // Remove all pending send message requests. |
| 399 MessageRequestQueue empty; | 399 MessageRequestQueue empty; |
| 400 std::swap(message_request_queue_, empty); | 400 std::swap(message_request_queue_, empty); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void PresentationDispatcher::OnDestruct() { | 403 void PresentationDispatcher::OnDestruct() { |
| 404 delete this; | 404 delete this; |
| 405 } | 405 } |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 | 784 |
| 785 PresentationDispatcher::ListeningStatus::ListeningStatus( | 785 PresentationDispatcher::ListeningStatus::ListeningStatus( |
| 786 const GURL& availability_url) | 786 const GURL& availability_url) |
| 787 : url(availability_url), | 787 : url(availability_url), |
| 788 last_known_availability(ScreenAvailability::UNKNOWN), | 788 last_known_availability(ScreenAvailability::UNKNOWN), |
| 789 listening_state(ListeningState::INACTIVE) {} | 789 listening_state(ListeningState::INACTIVE) {} |
| 790 | 790 |
| 791 PresentationDispatcher::ListeningStatus::~ListeningStatus() {} | 791 PresentationDispatcher::ListeningStatus::~ListeningStatus() {} |
| 792 | 792 |
| 793 } // namespace content | 793 } // namespace content |
| OLD | NEW |