Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1342)

Unified Diff: remoting/host/it2me/it2me_native_messaging_host_main.cc

Issue 2961333002: Fix field trials not working in utility processes. (Closed)
Patch Set: fix clang Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/it2me/it2me_native_messaging_host_main.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host_main.cc b/remoting/host/it2me/it2me_native_messaging_host_main.cc
index 129d7e1818afb2c8fd3d05e102d7cf7b75143418..5f3794805f5c1ab1e693f14c776d1133181092fc 100644
--- a/remoting/host/it2me/it2me_native_messaging_host_main.cc
+++ b/remoting/host/it2me/it2me_native_messaging_host_main.cc
@@ -40,11 +40,30 @@
#include <commctrl.h>
#include "remoting/host/switches.h"
-#include "remoting/host/win/elevation_helpers.h"
#endif // defined(OS_WIN)
namespace remoting {
+namespace {
+
+#if defined(OS_WIN) && defined(OFFICIAL_BUILD)
+bool CurrentProcessHasUiAccess() {
+ HANDLE process_token;
+ OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &process_token);
+
+ DWORD size;
+ DWORD uiaccess_value = 0;
+ if (!GetTokenInformation(process_token, TokenUIAccess, &uiaccess_value,
+ sizeof(uiaccess_value), &size)) {
+ PLOG(ERROR) << "GetTokenInformation() failed";
+ }
+ CloseHandle(process_token);
+ return uiaccess_value != 0;
+}
+#endif
Sergey Ulanov 2017/06/29 23:57:23 // defined(OS_WIN) && defined(OFFICIAL_BUILD)
jam 2017/06/30 14:39:58 Done.
+
+} // namespace
+
// Creates a It2MeNativeMessagingHost instance, attaches it to stdin/stdout and
// runs the message loop until It2MeNativeMessagingHost signals shutdown.
int It2MeNativeMessagingHostMain(int argc, char** argv) {
« no previous file with comments | « content/browser/utility_process_host_impl.cc ('k') | remoting/host/setup/me2me_native_messaging_host_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698