Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Side by Side Diff: chrome/test/data/extensions/platform_apps/web_view/focus/inject_focus_take_focus.js

Issue 2732913005: <webview>: Add test to confirm the TAB key will escape the view. (Closed)
Patch Set: rebase (focus controller change in ToT) Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var embedder = null;
6
7 var LOG = function(msg) {
8 window.console.log(msg);
9 };
10
11 var sendMessage = function(msgArray) {
12 if (embedder) {
13 embedder.postMessage(JSON.stringify(msgArray), '*');
14 }
15 };
16
17 var init = function() {
18 var input = document.createElement('input');
19 input.style.width = '100%';
20 input.addEventListener('focus', function(e) {
21 sendMessage(['focused']);
22 });
23
24 document.body.appendChild(input);
25
26 window.addEventListener('message', function(e) {
27 var data = JSON.parse(e.data);
28 embedder = e.source;
29 LOG('message, data: ' + data);
30 if (data[0] == 'connect') {
31 sendMessage(['connected']);
32 } else if (data[0] == 'request-coords') {
33 var rect = input.getBoundingClientRect();
34 sendMessage(['response-coords',
35 rect.left + 0.5 * rect.width,
36 rect.top + 0.5 * rect.height]);
37 }
38 });
39 };
40
41 init();
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/focus/embedder.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698