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

Side by Side Diff: chrome/browser/resources/gaia_auth/main.js

Issue 141083005: Disable context menu on signin page in the embedded flow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/gaia_auth/OWNERS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 /** 5 /**
6 * Authenticator class wraps the communications between Gaia and its host. 6 * Authenticator class wraps the communications between Gaia and its host.
7 */ 7 */
8 function Authenticator() { 8 function Authenticator() {
9 } 9 }
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 var gaiaFrame = $('gaia-frame'); 161 var gaiaFrame = $('gaia-frame');
162 gaiaFrame.partition = this.partitionId_; 162 gaiaFrame.partition = this.partitionId_;
163 gaiaFrame.src = this.initialFrameUrl_; 163 gaiaFrame.src = this.initialFrameUrl_;
164 if (this.inlineMode_) { 164 if (this.inlineMode_) {
165 gaiaFrame.addEventListener( 165 gaiaFrame.addEventListener(
166 'loadstop', this.onWebviewLoadstop_.bind(this, gaiaFrame)); 166 'loadstop', this.onWebviewLoadstop_.bind(this, gaiaFrame));
167 gaiaFrame.addEventListener( 167 gaiaFrame.addEventListener(
168 'newwindow', this.onWebviewNewWindow_.bind(this, gaiaFrame)); 168 'newwindow', this.onWebviewNewWindow_.bind(this, gaiaFrame));
169 } 169 }
170 if (this.constrained_) { 170 if (this.constrained_) {
171 var preventContextMenu = 'document.addEventListener("contextmenu", ' +
172 'function(e) {e.preventDefault();})';
173 gaiaFrame.executeScript({code: preventContextMenu});
171 gaiaFrame.request.onCompleted.addListener( 174 gaiaFrame.request.onCompleted.addListener(
172 this.onWebviewRequestCompleted_.bind(this), 175 this.onWebviewRequestCompleted_.bind(this),
173 {urls: ['<all_urls>'], types: ['main_frame']}, 176 {urls: ['<all_urls>'], types: ['main_frame']},
174 ['responseHeaders']); 177 ['responseHeaders']);
175 } 178 }
176 }, 179 },
177 180
178 completeLogin: function(username, password) { 181 completeLogin: function(username, password) {
179 var msg = { 182 var msg = {
180 'method': 'completeLogin', 183 'method': 'completeLogin',
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } else if (msg.method == 'redirectToSignin' && 337 } else if (msg.method == 'redirectToSignin' &&
335 this.isParentMessage_(e)) { 338 this.isParentMessage_(e)) {
336 $('gaia-frame').src = this.constructInitialFrameUrl_(); 339 $('gaia-frame').src = this.constructInitialFrameUrl_();
337 } else { 340 } else {
338 console.error('Authenticator.onMessage: unknown message + origin!?'); 341 console.error('Authenticator.onMessage: unknown message + origin!?');
339 } 342 }
340 } 343 }
341 }; 344 };
342 345
343 Authenticator.getInstance().initialize(); 346 Authenticator.getInstance().initialize();
OLDNEW
« no previous file with comments | « chrome/browser/resources/gaia_auth/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698