Commit 2d52e883 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

Fixes handling of promo browser commands sent by OneGoogle callout

CommandId and ClickInfo are sent by OneGoogle inside a 'data' property
in MessageEvent.data. This CL fixes handling of OneGoogle promo browser
commands by looking for CommandId and ClickInfo in
MessageEvent.data.data

Bug: 1106421
Change-Id: I87f2d58ea47aa71e6662bb331170d0074cefb212
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2376979
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Auto-Submit: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802384}
parent 4621493f
...@@ -728,7 +728,7 @@ class AppElement extends PolymerElement { ...@@ -728,7 +728,7 @@ class AppElement extends PolymerElement {
$$(this, '#oneGoogleBar').style.zIndex = '0'; $$(this, '#oneGoogleBar').style.zIndex = '0';
} else if (data.messageType === 'execute-browser-command') { } else if (data.messageType === 'execute-browser-command') {
this.executePromoBrowserCommand_( this.executePromoBrowserCommand_(
/** @type CommandData */ (data), event.source, event.origin); /** @type {!CommandData} */ (data.data), event.source, event.origin);
} }
} }
...@@ -756,7 +756,7 @@ class AppElement extends PolymerElement { ...@@ -756,7 +756,7 @@ class AppElement extends PolymerElement {
this.pageHandler_.onPromoLinkClicked(); this.pageHandler_.onPromoLinkClicked();
} else if (data.messageType === 'execute-browser-command') { } else if (data.messageType === 'execute-browser-command') {
this.executePromoBrowserCommand_( this.executePromoBrowserCommand_(
/** @type CommandData */ (data), event.source, event.origin); /** @type {!CommandData} */ (data), event.source, event.origin);
} }
} }
......
...@@ -411,8 +411,10 @@ suite('NewTabPageAppTest', () => { ...@@ -411,8 +411,10 @@ suite('NewTabPageAppTest', () => {
data: { data: {
frameType: 'one-google-bar', frameType: 'one-google-bar',
messageType: 'execute-browser-command', messageType: 'execute-browser-command',
commandId, data: {
clickInfo, commandId,
clickInfo,
},
}, },
source: window, source: window,
origin: window.origin, origin: window.origin,
......
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