OLD | NEW |
1 <html i18n-values="dir:textdirection;"> | 1 <html i18n-values="dir:textdirection;"> |
2 <head> | 2 <head> |
3 <title></title> | 3 <title></title> |
4 <style type="text/css"> | 4 <style type="text/css"> |
5 body { | 5 body { |
6 line-height: 1.4em; | 6 line-height: 1.4em; |
7 background: #FFFFFF; | 7 background: #FFFFFF; |
8 font-size: 11pt; | 8 font-size: 11pt; |
9 } | 9 } |
10 html[os='mac'] body { | 10 html[os='mac'] body { |
11 line-height: 1.5em; | 11 line-height: 1.5em; |
12 background: #FFFFFF; | 12 background: #FFFFFF; |
13 } | 13 } |
14 form { | 14 form { |
15 -webkit-user-select: none; | 15 -webkit-user-select: none; |
16 } | 16 } |
17 .sync-header { | 17 .sync-header { |
18 font-size: 1.2em; | 18 font-size: 1.2em; |
19 font-weight: bold; | 19 font-weight: bold; |
20 margin-bottom: 10px; | 20 margin-bottom: 10px; |
21 } | 21 } |
22 .sync-instructions { | 22 .sync-instructions-start-hidden { |
23 margin-top: 10px; | 23 margin-top: 10px; |
| 24 display: none; |
24 } | 25 } |
25 .sync-footer { | 26 .sync-footer { |
26 position: fixed; | 27 position: fixed; |
27 right: 0px; | 28 right: 0px; |
28 bottom: 0px; | 29 bottom: 0px; |
29 margin-right: 10px; | 30 margin-right: 10px; |
30 margin-bottom: 10px; | 31 margin-bottom: 10px; |
31 } | 32 } |
32 html[dir='rtl'] .sync-footer { | 33 html[dir='rtl'] .sync-footer { |
33 text-align: left; | 34 text-align: left; |
34 left: 0px; | 35 left: 0px; |
35 bottom: 0px; | 36 bottom: 0px; |
36 margin-left: 20px; | 37 margin-left: 20px; |
37 } | 38 } |
38 input[type='button'], | 39 input[type='button'], |
39 input[type='submit'] { | 40 input[type='submit'] { |
40 min-width: 87px; | 41 min-width: 87px; |
41 min-height: 26px; | 42 min-height: 26px; |
42 } | 43 } |
43 html[os='mac'] input[type='button'], | 44 html[os='mac'] input[type='button'], |
44 html[os='mac'] input[type='submit'] { | 45 html[os='mac'] input[type='submit'] { |
45 font-size: 12pt; | 46 font-size: 12pt; |
46 } | 47 } |
47 | |
48 #passphrase-input { | 48 #passphrase-input { |
| 49 margin-top: 20px; |
| 50 margin-bottom: 20px; |
| 51 } |
| 52 #incorrectPassphrase { |
49 margin-top: 5px; | 53 margin-top: 5px; |
50 margin-bottom: 50px; | 54 } |
| 55 .error { |
| 56 color: red; |
51 } | 57 } |
52 </style> | 58 </style> |
53 <script src="chrome://resources/js/cr.js"></script> | 59 <script src="chrome://resources/js/cr.js"></script> |
54 <script> | 60 <script> |
55 var currentMode; | |
56 | |
57 // Called once, when this html/js is loaded. | 61 // Called once, when this html/js is loaded. |
58 function setupPassphraseDialog(args) { | 62 function setupPassphraseDialog(args) { |
59 // Allow platform specific rules | 63 // Allow platform specific rules |
60 if (cr.isMac) { | 64 if (cr.isMac) { |
61 document.documentElement.setAttribute('os', 'mac'); | 65 document.documentElement.setAttribute('os', 'mac'); |
62 } else if (!cr.isWindows) { | 66 } else if (!cr.isWindows) { |
63 document.documentElement.setAttribute('os', 'linux'); | 67 document.documentElement.setAttribute('os', 'linux'); |
64 } | 68 } |
| 69 |
| 70 document.getElementById("passphraseRejectedBody").style.display = "none"; |
| 71 document.getElementById("normalBody").style.display = "none"; |
| 72 document.getElementById("incorrectPassphrase").style.display = "none"; |
| 73 |
| 74 if (args["passphrase_creation_rejected"]) { |
| 75 document.getElementById("passphraseRejectedBody").style.display = "block"; |
| 76 } else { |
| 77 document.getElementById("normalBody").style.display = "block"; |
| 78 } |
| 79 |
| 80 if (args["passphrase_setting_rejected"]) { |
| 81 document.getElementById("incorrectPassphrase").style.display = "block"; |
| 82 } |
65 } | 83 } |
66 | 84 |
67 function sendPassphraseAndClose() { | 85 function sendPassphraseAndClose() { |
68 var f = document.getElementById("passphraseForm"); | 86 var f = document.getElementById("passphraseForm"); |
69 var result = JSON.stringify({"passphrase": f.passphrase.value, | 87 var result = JSON.stringify({"passphrase": f.passphrase.value}); |
70 "mode": currentMode}); | |
71 chrome.send("Passphrase", [result]); | 88 chrome.send("Passphrase", [result]); |
72 } | 89 } |
73 | 90 |
74 function goToDashboard() { | 91 function goToDashboard() { |
75 chrome.send("GoToDashboard", [""]); | 92 chrome.send("GoToDashboard", [""]); |
76 chrome.send("DialogClose", [""]); | 93 chrome.send("DialogClose", [""]); |
77 } | 94 } |
78 </script> | 95 </script> |
79 </head> | 96 </head> |
80 <body i18n-values=".style.fontFamily:fontfamily" | 97 <body i18n-values=".style.fontFamily:fontfamily" |
81 onload="setupPassphraseDialog();"> | 98 onload="setupPassphraseDialog(JSON.parse(chrome.dialogArguments));"> |
82 <form id="passphraseForm" | 99 <form id="passphraseForm" |
83 onSubmit="sendPassphraseAndClose(); return false;"> | 100 onSubmit="sendPassphraseAndClose(); return false;"> |
84 <div id="enter-passphrase"> | 101 <div id="enter-passphrase"> |
85 <div class="sync-header" id="enterTitle" | 102 <div class="sync-header" id="enterTitle" |
86 i18n-content="enterPassphraseTitle"></div> | 103 i18n-content="enterPassphraseTitle"></div> |
87 <div class="sync-instructions" id="enterInstructions" | 104 <div class="sync-instructions-start-hidden" id="normalBody" |
88 i18n-content="enterPassphraseBody"></div> | 105 i18n-content="enterPassphraseBody"></div> |
| 106 <div class="sync-instructions-start-hidden" id="passphraseRejectedBody" |
| 107 i18n-content="enterOtherPassphraseBody"></div> |
89 </div> | 108 </div> |
90 | 109 |
91 <div id="passphrase-input"> | 110 <div id="passphrase-input"> |
92 <label id="passphraseLabel" name="passphraseLabel" | 111 <label id="passphraseLabel" name="passphraseLabel" |
93 for="passphrase" i18n-content="passphraseLabel"> | 112 for="passphrase" i18n-content="passphraseLabel"> |
94 </label> | 113 </label> |
95 <input id="passphrase" name="passphrase" type="password" /> | 114 <input id="passphrase" name="passphrase" type="password" /> |
| 115 <div class="error" id="incorrectPassphrase" |
| 116 i18n-content="incorrectPassphrase"> |
| 117 </div> |
96 </div> | 118 </div> |
97 | 119 |
98 <div id="sync-passphrase-warning" i18n-content="passphraseWarning"> | 120 <span id="sync-passphrase-warning" i18n-content="passphraseRecover"> |
99 </div> | 121 </span> <a id="clear-data-link" i18n-content="cleardatalink" href="#" |
100 <a id="clear-data-link" i18n-content="cleardatalink" href="#" | |
101 onclick='goToDashboard(); return false;'></a> | 122 onclick='goToDashboard(); return false;'></a> |
102 | 123 |
103 <div class="sync-footer"> | 124 <div class="sync-footer"> |
104 <input id="okButton" type="submit" i18n-values="value:ok" /> | 125 <input id="okButton" type="submit" i18n-values="value:ok" /> |
105 <input id="cancelButton" type="button" i18n-values="value:cancel" | 126 <input id="cancelButton" type="button" i18n-values="value:cancel" |
106 onclick='chrome.send("DialogClose", [""])' /> | 127 onclick='chrome.send("DialogClose", [""])' /> |
107 </div> | 128 </div> |
108 </form> | 129 </form> |
109 </body> | 130 </body> |
110 </html> | 131 </html> |
OLD | NEW |