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

Unified Diff: chrome/browser/resources/identity_api_ui/scope_approval_dialog.js

Issue 14081014: Identity API: Change WebAuthFlow to use <webview> instead of a normal browser pop-up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chrome.identity side-by-side with chrome.experimental.identity Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/identity_api_ui/scope_approval_dialog.js
diff --git a/chrome/browser/resources/identity_api_ui/scope_approval_dialog.js b/chrome/browser/resources/identity_api_ui/scope_approval_dialog.js
new file mode 100644
index 0000000000000000000000000000000000000000..e5fada62d1a9276ff5fa36b7627a90c46d32d910
--- /dev/null
+++ b/chrome/browser/resources/identity_api_ui/scope_approval_dialog.js
@@ -0,0 +1,31 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var webview = document.querySelector('webview');
+
+function start(url, win) {
+ webview.src = url;
+ if (win) {
+ webview.addEventListener('loadstop', function() {
+ win.show();
+ });
+ }
+}
+
+document.querySelector('.titlebar-close-button').onclick = function() {
+ window.close();
+};
+
+chrome.identityPrivate.getResources(function(resources) {
+ var style = document.styleSheets[0];
+
+ function insertRule(selector, url) {
+ style.insertRule(selector + ' { background-image: url(' + url + '); }',
+ style.cssRules.length);
+ }
+
+ insertRule('.titlebar-close-button', resources.IDR_CLOSE_DIALOG);
+ insertRule('.titlebar-close-button:hover', resources.IDR_CLOSE_DIALOG_H);
+ insertRule('.titlebar-close-button:active', resources.IDR_CLOSE_DIALOG_P);
+});
« no previous file with comments | « chrome/browser/resources/identity_api_ui/scope_approval_dialog.html ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698