| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 issue_title = l10n_util::GetStringUTF8( | 584 issue_title = l10n_util::GetStringUTF8( |
| 585 IDS_MEDIA_ROUTER_ISSUE_CREATE_ROUTE_TIMEOUT_FOR_DESKTOP); | 585 IDS_MEDIA_ROUTER_ISSUE_CREATE_ROUTE_TIMEOUT_FOR_DESKTOP); |
| 586 break; | 586 break; |
| 587 default: | 587 default: |
| 588 NOTREACHED(); | 588 NOTREACHED(); |
| 589 } | 589 } |
| 590 | 590 |
| 591 Issue issue(issue_title, std::string(), | 591 Issue issue(issue_title, std::string(), |
| 592 IssueAction(IssueAction::TYPE_DISMISS), | 592 IssueAction(IssueAction::TYPE_DISMISS), |
| 593 std::vector<IssueAction>(), std::string(), Issue::NOTIFICATION, | 593 std::vector<IssueAction>(), std::string(), Issue::NOTIFICATION, |
| 594 false, std::string()); | 594 false, -1); |
| 595 AddIssue(issue); | 595 AddIssue(issue); |
| 596 } | 596 } |
| 597 | 597 |
| 598 void MediaRouterUI::SendIssueForUnableToCast(MediaCastMode cast_mode) { | 598 void MediaRouterUI::SendIssueForUnableToCast(MediaCastMode cast_mode) { |
| 599 // For a generic error, claim a tab error unless it was specifically desktop | 599 // For a generic error, claim a tab error unless it was specifically desktop |
| 600 // mirroring. | 600 // mirroring. |
| 601 std::string issue_title = | 601 std::string issue_title = |
| 602 (cast_mode == MediaCastMode::DESKTOP_MIRROR) | 602 (cast_mode == MediaCastMode::DESKTOP_MIRROR) |
| 603 ? l10n_util::GetStringUTF8( | 603 ? l10n_util::GetStringUTF8( |
| 604 IDS_MEDIA_ROUTER_ISSUE_UNABLE_TO_CAST_DESKTOP) | 604 IDS_MEDIA_ROUTER_ISSUE_UNABLE_TO_CAST_DESKTOP) |
| 605 : l10n_util::GetStringUTF8( | 605 : l10n_util::GetStringUTF8( |
| 606 IDS_MEDIA_ROUTER_ISSUE_CREATE_ROUTE_TIMEOUT_FOR_TAB); | 606 IDS_MEDIA_ROUTER_ISSUE_CREATE_ROUTE_TIMEOUT_FOR_TAB); |
| 607 AddIssue(Issue(issue_title, std::string(), | 607 AddIssue(Issue(issue_title, std::string(), |
| 608 IssueAction(IssueAction::TYPE_DISMISS), | 608 IssueAction(IssueAction::TYPE_DISMISS), |
| 609 std::vector<IssueAction>(), std::string(), Issue::WARNING, | 609 std::vector<IssueAction>(), std::string(), Issue::WARNING, |
| 610 false, std::string())); | 610 false, -1)); |
| 611 } | 611 } |
| 612 | 612 |
| 613 GURL MediaRouterUI::GetFrameURL() const { | 613 GURL MediaRouterUI::GetFrameURL() const { |
| 614 return presentation_request_ ? presentation_request_->frame_url() : GURL(); | 614 return presentation_request_ ? presentation_request_->frame_url() : GURL(); |
| 615 } | 615 } |
| 616 | 616 |
| 617 std::string MediaRouterUI::GetPresentationRequestSourceName() const { | 617 std::string MediaRouterUI::GetPresentationRequestSourceName() const { |
| 618 GURL gurl = GetFrameURL(); | 618 GURL gurl = GetFrameURL(); |
| 619 return gurl.SchemeIs(extensions::kExtensionScheme) | 619 return gurl.SchemeIs(extensions::kExtensionScheme) |
| 620 ? GetExtensionName(gurl, extensions::ExtensionRegistry::Get( | 620 ? GetExtensionName(gurl, extensions::ExtensionRegistry::Get( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 base::Time::Now() - start_time_); | 654 base::Time::Now() - start_time_); |
| 655 start_time_ = base::Time(); | 655 start_time_ = base::Time(); |
| 656 } | 656 } |
| 657 } | 657 } |
| 658 | 658 |
| 659 void MediaRouterUI::UpdateMaxDialogHeight(int height) { | 659 void MediaRouterUI::UpdateMaxDialogHeight(int height) { |
| 660 handler_->UpdateMaxDialogHeight(height); | 660 handler_->UpdateMaxDialogHeight(height); |
| 661 } | 661 } |
| 662 | 662 |
| 663 } // namespace media_router | 663 } // namespace media_router |
| OLD | NEW |