Chromium Code Reviews| 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 "chrome/browser/ui/webui/media_router/media_router_ui.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 414 bool for_default_source = cast_mode == MediaCastMode::DEFAULT; | 414 bool for_default_source = cast_mode == MediaCastMode::DEFAULT; |
| 415 if (for_default_source && !presentation_request_) { | 415 if (for_default_source && !presentation_request_) { |
| 416 DLOG(ERROR) << "Requested to create a route for presentation, but " | 416 DLOG(ERROR) << "Requested to create a route for presentation, but " |
| 417 << "presentation request is missing."; | 417 << "presentation request is missing."; |
| 418 return false; | 418 return false; |
| 419 } | 419 } |
| 420 | 420 |
| 421 current_route_request_id_ = ++route_request_counter_; | 421 current_route_request_id_ = ++route_request_counter_; |
| 422 *origin = for_default_source ? presentation_request_->frame_url().GetOrigin() | 422 *origin = for_default_source ? presentation_request_->frame_url().GetOrigin() |
| 423 : GURL(chrome::kChromeUIMediaRouterURL); | 423 : GURL(chrome::kChromeUIMediaRouterURL); |
| 424 DVLOG(1) << "DoCreateRoute: origin: " << *origin; | |
| 424 DCHECK(origin->is_valid()); | 425 DCHECK(origin->is_valid()); |
|
imcheng
2016/10/21 23:58:03
We should probably remove this DCHECK since we are
| |
| 425 | 426 |
| 426 DVLOG(1) << "DoCreateRoute: origin: " << *origin; | |
| 427 | 427 |
| 428 // There are 3 cases. In cases (1) and (3) the MediaRouterUI will need to be | 428 // There are 3 cases. In cases (1) and (3) the MediaRouterUI will need to be |
| 429 // notified. In case (2) the dialog will be closed. | 429 // notified. In case (2) the dialog will be closed. |
| 430 // (1) Non-presentation route request (e.g., mirroring). No additional | 430 // (1) Non-presentation route request (e.g., mirroring). No additional |
| 431 // notification necessary. | 431 // notification necessary. |
| 432 // (2) Presentation route request for a Presentation API startSession call. | 432 // (2) Presentation route request for a Presentation API startSession call. |
| 433 // The startSession (CreatePresentationConnectionRequest) will need to be | 433 // The startSession (CreatePresentationConnectionRequest) will need to be |
| 434 // answered with the route response. | 434 // answered with the route response. |
| 435 // (3) Browser-initiated presentation route request. If successful, | 435 // (3) Browser-initiated presentation route request. If successful, |
| 436 // PresentationServiceDelegateImpl will have to be notified. Note that we | 436 // PresentationServiceDelegateImpl will have to be notified. Note that we |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 base::Time::Now() - start_time_); | 692 base::Time::Now() - start_time_); |
| 693 start_time_ = base::Time(); | 693 start_time_ = base::Time(); |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 | 696 |
| 697 void MediaRouterUI::UpdateMaxDialogHeight(int height) { | 697 void MediaRouterUI::UpdateMaxDialogHeight(int height) { |
| 698 handler_->UpdateMaxDialogHeight(height); | 698 handler_->UpdateMaxDialogHeight(height); |
| 699 } | 699 } |
| 700 | 700 |
| 701 } // namespace media_router | 701 } // namespace media_router |
| OLD | NEW |