Commit 44e2fc52 authored by Xi Cheng's avatar Xi Cheng Committed by Commit Bot

Make sure kNotificationId and kAppId are mutual exclusive on Windows

Bug: 734095
Change-Id: I08275fff11aef97c3265a6832dc1485b4ef19b61
Reviewed-on: https://chromium-review.googlesource.com/1038432
Commit-Queue: Xi Cheng <chengx@chromium.org>
Reviewed-by: default avatarTommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555986}
parent c0217d7d
...@@ -373,6 +373,20 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile, ...@@ -373,6 +373,20 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
DCHECK(profile); DCHECK(profile);
profile_ = profile; profile_ = profile;
#if defined(OS_WIN)
// If the command line has the kNotificationLaunchId switch, then this
// Launch() call is from notification_helper.exe to process toast activation.
// Delegate to the notification system; do not open a browser window here.
if (command_line_.HasSwitch(switches::kNotificationLaunchId)) {
DCHECK(!command_line_.HasSwitch(switches::kAppId));
if (NotificationPlatformBridgeWin::HandleActivation(command_line_)) {
RecordLaunchModeHistogram(LM_WIN_PLATFORM_NOTIFICATION);
return true;
}
return false;
}
#endif // defined(OS_WIN)
if (command_line_.HasSwitch(switches::kAppId)) { if (command_line_.HasSwitch(switches::kAppId)) {
std::string app_id = command_line_.GetSwitchValueASCII(switches::kAppId); std::string app_id = command_line_.GetSwitchValueASCII(switches::kAppId);
const Extension* extension = GetPlatformApp(profile, app_id); const Extension* extension = GetPlatformApp(profile, app_id);
...@@ -390,19 +404,6 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile, ...@@ -390,19 +404,6 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile,
} }
} }
#if defined(OS_WIN)
// If the command line has the kNotificationLaunchId switch, then this
// Launch() call is from notification_helper.exe to process toast activation.
// Delegate to the notification system; do not open a browser window here.
if (command_line_.HasSwitch(switches::kNotificationLaunchId)) {
if (NotificationPlatformBridgeWin::HandleActivation(command_line_)) {
RecordLaunchModeHistogram(LM_WIN_PLATFORM_NOTIFICATION);
return true;
}
return false;
}
#endif // defined(OS_WIN)
// Open the required browser windows and tabs. First, see if // Open the required browser windows and tabs. First, see if
// we're being run as an application window. If so, the user // we're being run as an application window. If so, the user
// opened an app shortcut. Don't restore tabs or open initial // opened an app shortcut. Don't restore tabs or open initial
......
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