Commit f39703db authored by Mike West's avatar Mike West Committed by Commit Bot

Revert "[MediaRouter] Add warning for invalid permissions"

This reverts commit b5bdc990.

Reason for revert: 
`MediaRouterViewsUITest.RouteCreationTimeoutForDesktop` started failing after this CL in https://ci.chromium.org/p/chromium/builders/ci/Mac10.15%20Tests/2446?blamelist=1#blamelist-tab. The error message in the related test is https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8874579294717582880/+/steps/unit_tests_on_Mac-10.15/0/logs/Deterministic_failure:_MediaRouterViewsUITest.RouteCreationTimeoutForDesktop__status_CRASH_/0:

```
Actual function call count doesn't match EXPECT_CALL(*mock_router_, CreateRouteInternal( _, _, _, _, _, base::TimeDelta::FromSeconds(timeout_seconds), false))...
         Expected: to be called once
           Actual: never called - unsatisfied and active
Stack trace:
0   unit_tests                          0x000000010fcfba8c testing::internal::GoogleTestFailureReporter::ReportFailure(testing::internal::FailureReporterInterface::FailureType, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 92
1   unit_tests                          0x000000010fcffc05 testing::internal::UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked() + 597
2   unit_tests                          0x000000010fd00521 testing::Mock::VerifyAndClearExpectationsLocked(void*) + 401
3   unit_tests                          0x000000010fd00371 testing::Mock::VerifyAndClearExpectations(void*) + 33
4   unit_tests                          0x000000010f26566b media_router::MediaRouterViewsUITest::StartCastingAndExpectTimeout(media_router::MediaCastMode, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) + 2491
5   unit_tests                          0x000000010f2659a4 media_router::MediaRouterViewsUITest_RouteCreationTimeoutForDesktop_Test::TestBody() + 52

Received signal 11 SEGV_MAPERR 000000000008
 [0x000114431eb9]
 [0x000114377dc3]
 [0x000114431dd1]
 [0x7fff70e295fd]
 [0x7fff70de9297]
 [0x00010f2659a4]
 [0x00010fd1860d]
 [0x00010fd193cf]
 [0x00010fd19d47]
 [0x00010fd283a7]
 [0x00010fd27e1f]
 [0x00011384b7fb]
 [0x0001138623b3]
 [0x00011386225f]
 [0x000113835f25]
 [0x7fff70c30cc9]
[end of stack trace]
```

Bug: 1106647


Original change's description:
> [MediaRouter] Add warning for invalid permissions
> 
> This patch adds a new check to the media router views UI that, on Mac OS
> X 10.15+ (Catalina), checks if the screen capture permission has been
> granted, and shows a warning message and fails to cast if so.
> 
> Bug: 1087236
> Change-Id: I3afdfdb06a011fee3e6fd5f199d375d0ab6eef88
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298479
> Commit-Queue: Jordan Bayles <jophba@chromium.org>
> Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#789194}

TBR=mfoltz@chromium.org,takumif@chromium.org,jophba@chromium.org

Change-Id: I64651c90503bf90a2f9cfca99f7929efd35b4c23
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1087236
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2302613Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789391}
parent ba321875
...@@ -76,13 +76,8 @@ ...@@ -76,13 +76,8 @@
<message name="IDS_MEDIA_ROUTER_ISSUE_TAB_AUDIO_NOT_SUPPORTED" desc="Title of an issue shown when the user is casting a tab, but only its visual content can be cast and not its audio output."> <message name="IDS_MEDIA_ROUTER_ISSUE_TAB_AUDIO_NOT_SUPPORTED" desc="Title of an issue shown when the user is casting a tab, but only its visual content can be cast and not its audio output.">
Casting tab audio is not supported on this device. Casting tab audio is not supported on this device.
</message> </message>
<if expr="is_macosx">
<message name="IDS_MEDIA_ROUTER_ISSUE_MAC_SCREEN_CAPTURE_PERMISSION_ERROR" desc="Title of an issue shown when the user is casting a window or desktop, and the associated MAC OS X 10.15+ system permission for 'Screen Recording' is not granted.">
Unable to cast screen. Check the Screen Recording permission in System Preferences.
</message>
</if>
<!-- Sink List --> <!-- Sink List -->
<message name="IDS_MEDIA_ROUTER_STATUS_LOOKING_FOR_DEVICES" desc="Status text temporarily shown while searching for Cast devices but none have been found."> <message name="IDS_MEDIA_ROUTER_STATUS_LOOKING_FOR_DEVICES" desc="Status text temporarily shown while searching for Cast devices but none have been found.">
Looking for devices Looking for devices
</message> </message>
......
...@@ -54,11 +54,6 @@ ...@@ -54,11 +54,6 @@
#include "ui/display/display.h" #include "ui/display/display.h"
#include "url/origin.h" #include "url/origin.h"
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#include "ui/base/cocoa/permissions_utils.h"
#endif
namespace media_router { namespace media_router {
namespace { namespace {
...@@ -373,15 +368,6 @@ bool MediaRouterViewsUI::CreateRoute(const MediaSink::Id& sink_id, ...@@ -373,15 +368,6 @@ bool MediaRouterViewsUI::CreateRoute(const MediaSink::Id& sink_id,
return false; return false;
} }
#if defined(OS_MACOSX)
if (base::mac::IsAtLeastOS10_15() &&
cast_mode == MediaCastMode::DESKTOP_MIRROR &&
!ui::IsScreenCaptureAllowed()) {
SendIssueForScreenPermission(sink_id);
return false;
}
#endif
GetIssueManager()->ClearNonBlockingIssues(); GetIssueManager()->ClearNonBlockingIssues();
auto on_document_available = base::BindOnce( auto on_document_available = base::BindOnce(
...@@ -759,18 +745,6 @@ void MediaRouterViewsUI::SendIssueForRouteTimeout( ...@@ -759,18 +745,6 @@ void MediaRouterViewsUI::SendIssueForRouteTimeout(
AddIssue(issue_info); AddIssue(issue_info);
} }
#if defined(OS_MACOSX)
void MediaRouterViewsUI::SendIssueForScreenPermission(
const MediaSink::Id& sink_id) {
std::string issue_title = l10n_util::GetStringUTF8(
IDS_MEDIA_ROUTER_ISSUE_MAC_SCREEN_CAPTURE_PERMISSION_ERROR);
IssueInfo issue_info(issue_title, IssueInfo::Action::DISMISS,
IssueInfo::Severity::WARNING);
issue_info.sink_id = sink_id;
AddIssue(issue_info);
}
#endif
void MediaRouterViewsUI::SendIssueForUnableToCast( void MediaRouterViewsUI::SendIssueForUnableToCast(
MediaCastMode cast_mode, MediaCastMode cast_mode,
const MediaSink::Id& sink_id) { const MediaSink::Id& sink_id) {
......
...@@ -233,14 +233,8 @@ class MediaRouterViewsUI ...@@ -233,14 +233,8 @@ class MediaRouterViewsUI
const MediaSink::Id& sink_id, const MediaSink::Id& sink_id,
const base::string16& presentation_request_source_name); const base::string16& presentation_request_source_name);
// Creates and sends an issue if casting fails due to lack of screen
// permissions.
#if defined(OS_MACOSX)
void SendIssueForScreenPermission(const MediaSink::Id& sink_id);
#endif
// Creates and sends an issue if casting fails for any reason other than // Creates and sends an issue if casting fails for any reason other than
// those above. // timeout.
void SendIssueForUnableToCast(MediaCastMode cast_mode, void SendIssueForUnableToCast(MediaCastMode cast_mode,
const MediaSink::Id& sink_id); const MediaSink::Id& sink_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment