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

Side by Side Diff: chrome/renderer/resources/extensions/web_view.js

Issue 20803004: Mark 'download' permissionrequest stable for <webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | chrome/renderer/resources/extensions/web_view_experimental.js » ('j') | 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 // Shim that simulates a <webview> tag via Mutation Observers. 5 // Shim that simulates a <webview> tag via Mutation Observers.
6 // 6 //
7 // The actual tag is implemented via the browser plugin. The internals of this 7 // The actual tag is implemented via the browser plugin. The internals of this
8 // are hidden via Shadow DOM. 8 // are hidden via Shadow DOM.
9 9
10 var addTagWatcher = require('tagWatcher').addTagWatcher; 10 var addTagWatcher = require('tagWatcher').addTagWatcher;
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 } 532 }
533 this.webviewNode_['insertCSS'] = function(var_args) { 533 this.webviewNode_['insertCSS'] = function(var_args) {
534 validateCall(); 534 validateCall();
535 var args = $Array.concat([self.browserPluginNode_.getGuestInstanceId()], 535 var args = $Array.concat([self.browserPluginNode_.getGuestInstanceId()],
536 $Array.slice(arguments)); 536 $Array.slice(arguments));
537 $Function.apply(chrome.webview.insertCSS, null, args); 537 $Function.apply(chrome.webview.insertCSS, null, args);
538 } 538 }
539 }; 539 };
540 540
541 /** 541 /**
542 * @private
543 */
544 WebView.prototype.getPermissionTypes_ = function() {
545 var PERMISSION_TYPES = ['media', 'geolocation', 'pointerLock'];
546 return PERMISSION_TYPES.concat(this.maybeGetExperimentalPermissionTypes_());
547 };
548
549 /**
550 * @param {!Object} detail The event details, originated from <object>. 542 * @param {!Object} detail The event details, originated from <object>.
551 * @private 543 * @private
552 */ 544 */
553 WebView.prototype.setupPermissionEvent_ = function() { 545 WebView.prototype.setupPermissionEvent_ = function() {
554 var ERROR_MSG_PERMISSION_ALREADY_DECIDED = '<webview>: ' + 546 var ERROR_MSG_PERMISSION_ALREADY_DECIDED = '<webview>: ' +
555 'Permission has already been decided for this "permissionrequest" event.'; 547 'Permission has already been decided for this "permissionrequest" event.';
556 548
557 var showWarningMessage = function(permission) { 549 var showWarningMessage = function(permission) {
558 var WARNING_MSG_PERMISSION_DENIED = '<webview>: ' + 550 var WARNING_MSG_PERMISSION_DENIED = '<webview>: ' +
559 'The permission request for "%1" has been denied.'; 551 'The permission request for "%1" has been denied.';
560 console.warn(WARNING_MSG_PERMISSION_DENIED.replace('%1', permission)); 552 console.warn(WARNING_MSG_PERMISSION_DENIED.replace('%1', permission));
561 }; 553 };
562 554
563 var PERMISSION_TYPES = this.getPermissionTypes_(); 555 var PERMISSION_TYPES = ['media', 'geolocation', 'pointerLock', 'download'];
564 556
565 var EXPOSED_PERMISSION_EVENT_ATTRIBS = [ 557 var EXPOSED_PERMISSION_EVENT_ATTRIBS = [
566 'lastUnlockedBySelf', 558 'lastUnlockedBySelf',
567 'permission', 559 'permission',
568 'requestMethod', 560 'requestMethod',
569 'url', 561 'url',
570 'userGesture' 562 'userGesture'
571 ]; 563 ];
572 564
573 var self = this; 565 var self = this;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 browserPluginNode['-internal-setPermission'](requestId, false, ''); 634 browserPluginNode['-internal-setPermission'](requestId, false, '');
643 showWarningMessage(detail.permission); 635 showWarningMessage(detail.permission);
644 } 636 }
645 }); 637 });
646 }; 638 };
647 639
648 /** 640 /**
649 * Implemented when the experimental API is available. 641 * Implemented when the experimental API is available.
650 * @private 642 * @private
651 */ 643 */
652 WebView.prototype.maybeGetExperimentalPermissionTypes_ = function() {
653 return [];
654 };
655
656 /**
657 * Implemented when the experimental API is available.
658 * @private
659 */
660 WebView.prototype.maybeSetupExperimentalAPI_ = function() {}; 644 WebView.prototype.maybeSetupExperimentalAPI_ = function() {};
661 645
662 exports.WebView = WebView; 646 exports.WebView = WebView;
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/resources/extensions/web_view_experimental.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698