diff options
author | weitaosu <weitaosu@chromium.org> | 2015-01-28 10:41:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-28 18:42:34 +0000 |
commit | 55c0c16b78bce6d968f1347e22cc404d75db5c82 (patch) | |
tree | 3664cc39f5d4bb2a44f41b69b9fde9dc62f36a85 /remoting/host/setup | |
parent | a6eadfffa64f816048e85991b544beac0ab164d0 (diff) | |
download | chromium_src-55c0c16b78bce6d968f1347e22cc404d75db5c82.zip chromium_src-55c0c16b78bce6d968f1347e22cc404d75db5c82.tar.gz chromium_src-55c0c16b78bce6d968f1347e22cc404d75db5c82.tar.bz2 |
UAC and pin confirmation dialogs are not on foreground when updating pin #
In this change we elevate the me2me native messaging host before calling into the daemon controller for the tasks that requires elevation. The daemon controller still depends on the com component for those tasks but the elevation is now done in the me2me native messaging host itself.
In followup CLs I will remove the elevated daemon controller com component and move its implementation to DaemonControllerDelegateWin.
Note that the pin confirmation dialog is removed with this CL. This change has been approved by the chrome security team.
BUG=447246
Review URL: https://codereview.chromium.org/880133003
Cr-Commit-Position: refs/heads/master@{#313545}
Diffstat (limited to 'remoting/host/setup')
-rw-r--r-- | remoting/host/setup/me2me_native_messaging_host.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc index 37bedac..e3480b1 100644 --- a/remoting/host/setup/me2me_native_messaging_host.cc +++ b/remoting/host/setup/me2me_native_messaging_host.cc @@ -280,6 +280,12 @@ void Me2MeNativeMessagingHost::ProcessUpdateDaemonConfig( scoped_ptr<base::DictionaryValue> response) { DCHECK(thread_checker_.CalledOnValidThread()); + if (needs_elevation_) { + if (!DelegateToElevatedHost(message.Pass())) + SendAsyncResult(response.Pass(), DaemonController::RESULT_FAILED); + return; + } + scoped_ptr<base::DictionaryValue> config_dict = ConfigDictionaryFromMessage(message.Pass()); if (!config_dict) { @@ -333,6 +339,12 @@ void Me2MeNativeMessagingHost::ProcessStartDaemon( scoped_ptr<base::DictionaryValue> response) { DCHECK(thread_checker_.CalledOnValidThread()); + if (needs_elevation_) { + if (!DelegateToElevatedHost(message.Pass())) + SendAsyncResult(response.Pass(), DaemonController::RESULT_FAILED); + return; + } + bool consent; if (!message->GetBoolean("consent", &consent)) { LOG(ERROR) << "'consent' not found."; @@ -358,6 +370,12 @@ void Me2MeNativeMessagingHost::ProcessStopDaemon( scoped_ptr<base::DictionaryValue> response) { DCHECK(thread_checker_.CalledOnValidThread()); + if (needs_elevation_) { + if (!DelegateToElevatedHost(message.Pass())) + SendAsyncResult(response.Pass(), DaemonController::RESULT_FAILED); + return; + } + daemon_controller_->Stop( base::Bind(&Me2MeNativeMessagingHost::SendAsyncResult, weak_ptr_, base::Passed(&response))); |