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

Side by Side Diff: chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js

Issue 272173004: Fixed close button for retina displays in identity approval scope UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698