Skip to content

Commit

Permalink
[Chromoting] Address review comments from crrev/1874504
Browse files Browse the repository at this point in the history
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: Jamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711958}
  • Loading branch information
garykac authored and Commit Bot committed Nov 2, 2019
1 parent 70f160b commit 0a895fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions remoting/host/mac/permission_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions remoting/host/remoting_me2me_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0a895fb

Please sign in to comment.