Chromium Code Reviews| Index: google_apis/test/embedded_setup_chromeos.html |
| diff --git a/google_apis/test/embedded_setup_chromeos.html b/google_apis/test/embedded_setup_chromeos.html |
| index d2175f00336984473505f1dc0c5ccd946e5ece05..858893cf86fe352708c97590d6b5efb9f270c322 100644 |
| --- a/google_apis/test/embedded_setup_chromeos.html |
| +++ b/google_apis/test/embedded_setup_chromeos.html |
| @@ -21,6 +21,7 @@ gaia.chromeOSLogin.registerHtml5Listener = function() { |
| } |
| }; |
| window.addEventListener('message', onMessage); |
| + window.addEventListener("popstate", function(e) { goBack(); }); |
| } |
| gaia.chromeOSLogin.clearOldAttempts = function() { |
| @@ -50,6 +51,19 @@ gaia.chromeOSLogin.backButton = function(show) { |
| gaia.chromeOSLogin.parent_webview_url_); |
| }; |
| +function goFirstPage() { |
| + document.getElementById("page1").hidden = false; |
| + document.getElementById("page2").hidden = true; |
| + history.replaceState({}, "", window.location.pathname + "#identifier"); |
|
Nikita (slow)
2015/04/14 20:06:13
nit: Use ' instead of "
Here and below
|
| + gaia.chromeOSLogin.backButton(false); |
| +} |
| + |
| +function goBack() { |
| + if (!document.getElementById("page2").hidden) { |
| + goFirstPage(); |
| + } |
| +} |
| + |
| function goNext() { |
| if (!document.getElementById("page1").hidden) { |
| document.getElementById("page1").hidden = true; |
| @@ -88,8 +102,7 @@ function goNext() { |
| function onLoad() { |
| gaia.chromeOSLogin.registerHtml5Listener(); |
| - document.getElementById("page1").hidden = false; |
| - history.replaceState({}, "", window.location.pathname + "#identifier"); |
| + goFirstPage(); |
| gaia.chromeOSLogin.clearOldAttempts(); |
| } |