| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 var webview; | 5 var webview; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Points the webview to the starting URL of a scope authorization | 8 * Points the webview to the starting URL of a scope authorization |
| 9 * flow, and unhides the dialog once the page has loaded. | 9 * flow, and unhides the dialog once the page has loaded. |
| 10 * @param {string} url The url of the authorization entry point. | 10 * @param {string} url The url of the authorization entry point. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 document.addEventListener('DOMContentLoaded', function() { | 43 document.addEventListener('DOMContentLoaded', function() { |
| 44 webview = document.querySelector('webview'); | 44 webview = document.querySelector('webview'); |
| 45 | 45 |
| 46 document.querySelector('.titlebar-close-button').onclick = function() { | 46 document.querySelector('.titlebar-close-button').onclick = function() { |
| 47 window.close(); | 47 window.close(); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 chrome.identityPrivate.getResources(function(resources) { | 50 chrome.identityPrivate.getStrings(function(strings) { |
| 51 var style = document.styleSheets[0]; | 51 document.title = strings['window-title']; |
| 52 | |
| 53 function insertRule(selector, url) { | |
| 54 style.insertRule(selector + ' { background-image: url(' + url + '); }', | |
| 55 style.cssRules.length); | |
| 56 } | |
| 57 | |
| 58 insertRule('.titlebar-close-button', resources.IDR_CLOSE_DIALOG); | |
| 59 insertRule('.titlebar-close-button:hover', resources.IDR_CLOSE_DIALOG_H); | |
| 60 insertRule('.titlebar-close-button:active', resources.IDR_CLOSE_DIALOG_P); | |
| 61 | |
| 62 document.title = resources.IDS_EXTENSION_PERMISSIONS_PROMPT_TITLE; | |
| 63 }); | 52 }); |
| 64 }); | 53 }); |
| 65 | 54 |
| OLD | NEW |