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

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

Issue 16452017: Identity API: handle window.open events from the scope approval webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: window.discard to release memory earlier Created 7 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js
diff --git a/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js b/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js
index b495e8c570833f95a55b6b8bdc4100c0e491f3ee..790a44c28ce7db4f919d69f04e1167081aa6388e 100644
--- a/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js
+++ b/chrome/browser/resources/identity_scope_approval_dialog/scope_approval_dialog.js
@@ -13,6 +13,13 @@ var webview;
* window.
*/
function loadAuthUrlAndShowWindow(url, win) {
+ // Send popups from the webview to a normal browser window.
+ webview.addEventListener('newwindow', function(e) {
+ e.window.discard();
+ window.open(e.targetUrl);
+ });
+
+ // Request a customized view from GAIA.
webview.onBeforeSendHeaders.addListener(function(details) {
headers = details.requestHeaders || [];
headers.push({'name': 'X-Browser-View',
@@ -21,6 +28,7 @@ function loadAuthUrlAndShowWindow(url, win) {
}, {
urls: ['https://accounts.google.com/*'],
}, ['blocking', 'requestHeaders']);
+
webview.src = url;
if (win) {
webview.addEventListener('loadstop', function() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698