OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 chrome.launcherPage.onTransitionChanged.addListener(function(progress) { | 5 chrome.launcherPage.onTransitionChanged.addListener(function(progress) { |
6 if (progress == 0) { | 6 if (progress == 0) { |
7 chrome.test.sendMessage('onPageProgressAt0'); | 7 chrome.test.sendMessage('onPageProgressAt0'); |
8 } else if (progress == 1) { | 8 } else if (progress == 1) { |
9 // Push 2 launcher page subpages. | 9 // Push 2 launcher page subpages. |
10 chrome.launcherPage.pushSubpage(function() { | 10 chrome.launcherPage.pushSubpage(function() { |
(...skipping 13 matching lines...) Expand all Loading... |
24 chrome.test.sendMessage('launcherPageDisabled'); | 24 chrome.test.sendMessage('launcherPageDisabled'); |
25 }); | 25 }); |
26 } | 26 } |
27 | 27 |
28 function enableCustomLauncherPage() { | 28 function enableCustomLauncherPage() { |
29 chrome.launcherPage.setEnabled(true, function() { | 29 chrome.launcherPage.setEnabled(true, function() { |
30 chrome.test.sendMessage('launcherPageEnabled'); | 30 chrome.test.sendMessage('launcherPageEnabled'); |
31 }); | 31 }); |
32 } | 32 } |
33 | 33 |
| 34 function hideCustomLauncherPage() { |
| 35 chrome.launcherPage.hide(function() { |
| 36 chrome.test.sendMessage('launcherPageHidden'); |
| 37 }); |
| 38 } |
| 39 |
34 document.addEventListener('DOMContentLoaded', function() { | 40 document.addEventListener('DOMContentLoaded', function() { |
35 chrome.test.sendMessage('Launched'); | 41 chrome.test.sendMessage('Launched'); |
36 }); | 42 }); |
37 | 43 |
38 var textfield = document.getElementById('textfield'); | 44 var textfield = document.getElementById('textfield'); |
39 textfield.onfocus = function() { | 45 textfield.onfocus = function() { |
40 chrome.test.sendMessage('textfieldFocused'); | 46 chrome.test.sendMessage('textfieldFocused'); |
41 }; | 47 }; |
42 | 48 |
43 textfield.onblur = function() { | 49 textfield.onblur = function() { |
44 chrome.test.sendMessage('textfieldBlurred'); | 50 chrome.test.sendMessage('textfieldBlurred'); |
45 }; | 51 }; |
OLD | NEW |