Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /** | |
|
Dan Beam
2013/04/05 01:07:37
does this need a copyright?
Jered
2013/04/05 15:30:23
Done.
| |
| 2 * @fileoverview Click handler for omnibox results. | |
| 3 */ | |
| 4 | |
| 5 /** | |
| 6 * The origin of the embedding page. | |
| 7 * Must be in double quotes for proper escaping. | |
|
Dan Beam
2013/04/05 01:07:37
what must be in double quotes? please clarify
Jered
2013/04/05 15:30:23
Done.
| |
| 8 * @type {string} | |
| 9 * @const | |
| 10 */ | |
| 11 var EMBEDDER_ORIGIN = "%s"; | |
| 12 | |
| 13 function handleClick(event) { | |
| 14 var clickMessage = {'click': event.button}; | |
| 15 top.postMessage(clickMessage, EMBEDDER_ORIGIN); | |
|
Dan Beam
2013/04/05 01:07:37
top.postMessage({click: event.button}, EMBEDDER_OR
Jered
2013/04/05 15:30:23
Done.
| |
| 16 } | |
| 17 | |
| 18 document.addEventListener('DOMContentLoaded', function() { | |
|
Dan Beam
2013/04/05 01:07:37
why do you need to wait until DOMContentLoaded?
Jered
2013/04/05 15:30:23
I don't. Done.
| |
| 19 window.addEventListener('click', handleClick, false); | |
| 20 }); | |
|
Dan Beam
2013/04/05 01:07:37
why is this all in the global namespace?
Jered
2013/04/05 15:30:23
Where would be better? (This script will be the on
| |
| OLD | NEW |