Commit 0a895fb9 authored by Gary Kacmarcik's avatar Gary Kacmarcik Committed by Commit Bot

[Chromoting] Address review comments from crrev/1874504

CL landed before I uploaded the changes from the review comments.
This cl contains those mods.

Change-Id: Iab52d890798053fde11f63f1c08aa7ed8709f85c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895920
Auto-Submit: Gary Kacmarcik <garykac@chromium.org>
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: default avatarJamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711958}
parent 70f160b3
......@@ -15,11 +15,15 @@ namespace remoting {
namespace mac {
// Return true if the current process has been granted permission to inject
// input.
// input. This will add an entry to the System Preference's Accessibility
// pane (if it doesn't exist already) and it may pop up a system dialog
// informing the user that this app is requesting permission.
bool CanInjectInput();
// Return true if the current process has been granted permission to record
// the screen.
// the screen. This will add an entry to the System Preference's Screen
// Recording pane (if it doesn't exist already) and it may pop up a system
// dialog informing the user that this app is requesting permission.
bool CanRecordScreen();
// Prompts the user to add the current application to the set of trusted
......
......@@ -192,11 +192,11 @@ const char kReportOfflineReasonSwitchName[] = "report-offline-reason";
#if defined(OS_MACOSX)
// Command line switch to check for Accessibility permission.
const char kCheckAccessibilityPermissionsSwitchName[] =
const char kCheckAccessibilityPermissionSwitchName[] =
"check-accessibility-permission";
// Command line switch to check for Screen Recording permission.
const char kCheckScreenRecordingPermissionsSwitchName[] =
const char kCheckScreenRecordingPermissionSwitchName[] =
"check-screen-recording-permission";
#endif // defined(OS_MACOSX)
......@@ -523,12 +523,12 @@ bool HostProcess::InitWithCommandLine(const base::CommandLine* cmd_line) {
// Ensure we are not running as root (i.e. at the login screen).
DCHECK_NE(getuid(), 0U);
if (cmd_line->HasSwitch(kCheckAccessibilityPermissionsSwitchName)) {
if (cmd_line->HasSwitch(kCheckAccessibilityPermissionSwitchName)) {
checking_permission_state_ = true;
permission_granted_ = mac::CanInjectInput();
return false;
}
if (cmd_line->HasSwitch(kCheckScreenRecordingPermissionsSwitchName)) {
if (cmd_line->HasSwitch(kCheckScreenRecordingPermissionSwitchName)) {
checking_permission_state_ = true;
permission_granted_ = mac::CanRecordScreen();
return false;
......
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