summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorgwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 23:01:52 +0000
committergwilson@google.com <gwilson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-18 23:01:52 +0000
commitc020ddcd758257c58849298027f6ca9dd5554efe (patch)
tree2c7cf8d853778efc6b3d6ca589d198c28f1f5938 /base
parent3e1fc8ea295d450e864b8e156617399f4f2f672f (diff)
downloadchromium_src-c020ddcd758257c58849298027f6ca9dd5554efe.zip
chromium_src-c020ddcd758257c58849298027f6ca9dd5554efe.tar.gz
chromium_src-c020ddcd758257c58849298027f6ca9dd5554efe.tar.bz2
Adds new API to process_utils to launch a new app as a user in a specified desktop. Also modifies toast behavior to use this API instead.
R=huanr,cpu BUG=none TEST=Run system-level toast with an attached user, toast should be visible. Review URL: http://codereview.chromium.org/596087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/process_util.h7
-rw-r--r--base/process_util_win.cc9
2 files changed, 15 insertions, 1 deletions
diff --git a/base/process_util.h b/base/process_util.h
index 99f68c0..a368698 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -154,6 +154,13 @@ bool LaunchApp(const std::wstring& cmdline,
bool LaunchAppAsUser(UserTokenHandle token, const std::wstring& cmdline,
bool start_hidden, ProcessHandle* process_handle);
+// Has the same behavior as LaunchAppAsUser, but offers the boolean option to
+// use an empty string for the desktop name.
+bool LaunchAppAsUser(UserTokenHandle token, const std::wstring& cmdline,
+ bool start_hidden, ProcessHandle* process_handle,
+ bool empty_desktop_name);
+
+
#elif defined(OS_POSIX)
// Runs the application specified in argv[0] with the command line argv.
// Before launching all FDs open in the parent process will be marked as
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index 3b1ab9a..8f08c1c 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -166,11 +166,18 @@ bool LaunchApp(const std::wstring& cmdline,
return true;
}
-
bool LaunchAppAsUser(UserTokenHandle token, const std::wstring& cmdline,
bool start_hidden, ProcessHandle* process_handle) {
+ return LaunchAppAsUser(token, cmdline, start_hidden, process_handle, false);
+}
+
+bool LaunchAppAsUser(UserTokenHandle token, const std::wstring& cmdline,
+ bool start_hidden, ProcessHandle* process_handle,
+ bool empty_desktop_name) {
STARTUPINFO startup_info = {0};
startup_info.cb = sizeof(startup_info);
+ if (empty_desktop_name)
+ startup_info.lpDesktop = L"";
PROCESS_INFORMATION process_info;
if (start_hidden) {
startup_info.dwFlags = STARTF_USESHOWWINDOW;