Commit 55c0c16b authored by weitaosu's avatar weitaosu Committed by Commit bot

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}
parent a6eadfff
...@@ -280,6 +280,12 @@ void Me2MeNativeMessagingHost::ProcessUpdateDaemonConfig( ...@@ -280,6 +280,12 @@ void Me2MeNativeMessagingHost::ProcessUpdateDaemonConfig(
scoped_ptr<base::DictionaryValue> response) { scoped_ptr<base::DictionaryValue> response) {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
if (needs_elevation_) {
if (!DelegateToElevatedHost(message.Pass()))
SendAsyncResult(response.Pass(), DaemonController::RESULT_FAILED);
return;
}
scoped_ptr<base::DictionaryValue> config_dict = scoped_ptr<base::DictionaryValue> config_dict =
ConfigDictionaryFromMessage(message.Pass()); ConfigDictionaryFromMessage(message.Pass());
if (!config_dict) { if (!config_dict) {
...@@ -333,6 +339,12 @@ void Me2MeNativeMessagingHost::ProcessStartDaemon( ...@@ -333,6 +339,12 @@ void Me2MeNativeMessagingHost::ProcessStartDaemon(
scoped_ptr<base::DictionaryValue> response) { scoped_ptr<base::DictionaryValue> response) {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
if (needs_elevation_) {
if (!DelegateToElevatedHost(message.Pass()))
SendAsyncResult(response.Pass(), DaemonController::RESULT_FAILED);
return;
}
bool consent; bool consent;
if (!message->GetBoolean("consent", &consent)) { if (!message->GetBoolean("consent", &consent)) {
LOG(ERROR) << "'consent' not found."; LOG(ERROR) << "'consent' not found.";
...@@ -358,6 +370,12 @@ void Me2MeNativeMessagingHost::ProcessStopDaemon( ...@@ -358,6 +370,12 @@ void Me2MeNativeMessagingHost::ProcessStopDaemon(
scoped_ptr<base::DictionaryValue> response) { scoped_ptr<base::DictionaryValue> response) {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
if (needs_elevation_) {
if (!DelegateToElevatedHost(message.Pass()))
SendAsyncResult(response.Pass(), DaemonController::RESULT_FAILED);
return;
}
daemon_controller_->Stop( daemon_controller_->Stop(
base::Bind(&Me2MeNativeMessagingHost::SendAsyncResult, weak_ptr_, base::Bind(&Me2MeNativeMessagingHost::SendAsyncResult, weak_ptr_,
base::Passed(&response))); base::Passed(&response)));
......
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