Index: chrome/browser/ui/startup/startup_browser_creator.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc |
index 11e51f87a412c529176e3afbb26c78733ad20f43..db287351e536a7c61a3664a5a2d45a774cc98e58 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc |
@@ -104,6 +104,10 @@ |
#include "components/search_engines/desktop_search_utils.h" |
#endif |
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
+#include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
+#endif |
+ |
#if defined(ENABLE_PRINT_PREVIEW) |
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h" |
@@ -712,6 +716,21 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( |
} |
#endif // defined(OS_WIN) |
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
+ // Our request to Activate may be discarded on some linux window |
+ // managers unless given a recent timestamp, so update the timestamp if |
+ // we were given one. |
+ if (command_line.HasSwitch(switches::kWmUserTimeMs)) { |
+ uint64_t time; |
+ std::string switchValue = |
sky
2016/05/07 16:58:34
switch_value
Tom (Use chromium acct)
2016/05/09 17:49:59
Done.
|
+ command_line.GetSwitchValueASCII(switches::kWmUserTimeMs); |
+ if (base::StringToUint64(switchValue, &time)) { |
+ views::X11DesktopHandler::get()->set_wm_user_time_ms( |
+ static_cast<Time>(time)); |
+ } |
+ } |
+#endif |
+ |
chrome::startup::IsProcessStartup is_process_startup = process_startup ? |
chrome::startup::IS_PROCESS_STARTUP : |
chrome::startup::IS_NOT_PROCESS_STARTUP; |
@@ -748,7 +767,6 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( |
last_used_profile = last_opened_profiles[0]; |
} |
#endif |
- |
// Launch the last used profile with the full command line, and the other |
// opened profiles without the URLs to launch. |
base::CommandLine command_line_without_urls(command_line.GetProgram()); |
@@ -772,7 +790,6 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( |
startup_pref.type == SessionStartupPref::DEFAULT && |
!HasPendingUncleanExit(*it)) |
continue; |
- |
if (!LaunchBrowser((*it == last_used_profile) ? command_line |
: command_line_without_urls, |
*it, cur_dir, is_process_startup, is_first_run)) |