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

Side by Side Diff: extensions/renderer/resources/guest_view/guest_view_deny.js

Issue 1290013003: This patch removes all files, directories, flags, and code related to SurfaceWorker, which is now d… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more deletion. Created 5 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // This module implements the registration of guestview elements when 5 // This module implements the registration of guestview elements when
6 // permissions are not available. These elements exist only to provide a useful 6 // permissions are not available. These elements exist only to provide a useful
7 // error message when developers attempt to use them. 7 // error message when developers attempt to use them.
8 8
9 var DocumentNatives = requireNative('document_natives'); 9 var DocumentNatives = requireNative('document_natives');
10 var GuestViewContainer = require('guestViewContainer').GuestViewContainer; 10 var GuestViewContainer = require('guestViewContainer').GuestViewContainer;
11 11
12 var ERROR_MESSAGE = 'You do not have permission to use the %1 element.' + 12 var ERROR_MESSAGE = 'You do not have permission to use the %1 element.' +
13 ' Be sure to declare the "%1" permission in your manifest file.'; 13 ' Be sure to declare the "%1" permission in your manifest file.';
14 14
15 // A list of view types that will have custom elements registered if they are 15 // A list of view types that will have custom elements registered if they are
16 // not already registered by the time this module is loaded. 16 // not already registered by the time this module is loaded.
17 var VIEW_TYPES = [ 17 var VIEW_TYPES = [
18 'AppView', 18 'AppView',
19 'ExtensionOptions', 19 'ExtensionOptions',
20 'ExtensionView', 20 'ExtensionView',
21 'SurfaceWorker',
22 'WebView' 21 'WebView'
23 ]; 22 ];
24 23
25 // Registers a GuestView custom element. 24 // Registers a GuestView custom element.
26 function registerGuestViewElement(viewType) { 25 function registerGuestViewElement(viewType) {
27 var proto = Object.create(HTMLElement.prototype); 26 var proto = Object.create(HTMLElement.prototype);
28 27
29 proto.createdCallback = function() { 28 proto.createdCallback = function() {
30 window.console.error(ERROR_MESSAGE.replace(/%1/g, viewType.toLowerCase())); 29 window.console.error(ERROR_MESSAGE.replace(/%1/g, viewType.toLowerCase()));
31 }; 30 };
(...skipping 18 matching lines...) Expand all
50 // Register the error-providing custom element only for those view types 49 // Register the error-providing custom element only for those view types
51 // that have not already been registered. Since this module is always loaded 50 // that have not already been registered. Since this module is always loaded
52 // last, all the view types that are available (i.e. have the proper 51 // last, all the view types that are available (i.e. have the proper
53 // permissions) will have already been registered on |window|. 52 // permissions) will have already been registered on |window|.
54 if (!window[VIEW_TYPES[i]]) 53 if (!window[VIEW_TYPES[i]])
55 registerGuestViewElement(VIEW_TYPES[i]); 54 registerGuestViewElement(VIEW_TYPES[i]);
56 } 55 }
57 56
58 window.removeEventListener(event.type, listener, useCapture); 57 window.removeEventListener(event.type, listener, useCapture);
59 }, useCapture); 58 }, useCapture);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698