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

Unified Diff: extensions/renderer/resources/web_view_request_custom_bindings.js

Issue 654043002: Created "guest_view/" directory to contain all the guestview files (like web_view* and app_view*) i… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « extensions/renderer/resources/web_view_internal.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/web_view_request_custom_bindings.js
diff --git a/extensions/renderer/resources/web_view_request_custom_bindings.js b/extensions/renderer/resources/web_view_request_custom_bindings.js
deleted file mode 100644
index 62f7459bad8686950517250fe2154c22b4c2b2fc..0000000000000000000000000000000000000000
--- a/extensions/renderer/resources/web_view_request_custom_bindings.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2014 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.
-
-// Custom binding for the webViewRequest API.
-
-var binding = require('binding').Binding.create('webViewRequest');
-
-var declarativeWebRequestSchema =
- requireNative('schema_registry').GetSchema('declarativeWebRequest');
-var utils = require('utils');
-var validate = require('schemaUtils').validate;
-
-binding.registerCustomHook(function(api) {
- var webViewRequest = api.compiledApi;
-
- // Returns the schema definition of type |typeId| defined in
- // |declarativeWebRequestScheme.types|.
- function getSchema(typeId) {
- return utils.lookup(declarativeWebRequestSchema.types,
- 'id',
- 'declarativeWebRequest.' + typeId);
- }
-
- // Helper function for the constructor of concrete datatypes of the
- // declarative webRequest API.
- // Makes sure that |this| contains the union of parameters and
- // {'instanceType': 'declarativeWebRequest.' + typeId} and validates the
- // generated union dictionary against the schema for |typeId|.
- function setupInstance(instance, parameters, typeId) {
- for (var key in parameters) {
- if ($Object.hasOwnProperty(parameters, key)) {
- instance[key] = parameters[key];
- }
- }
-
- instance.instanceType = 'declarativeWebRequest.' + typeId;
- var schema = getSchema(typeId);
- validate([instance], [schema]);
- }
-
- // Setup all data types for the declarative webRequest API from the schema.
- for (var i = 0; i < declarativeWebRequestSchema.types.length; ++i) {
- var typeSchema = declarativeWebRequestSchema.types[i];
- var typeId = typeSchema.id.replace('declarativeWebRequest.', '');
- var action = function(typeId) {
- return function(parameters) {
- setupInstance(this, parameters, typeId);
- };
- }(typeId);
- webViewRequest[typeId] = action;
- }
-});
-
-exports.binding = binding.generate();
« no previous file with comments | « extensions/renderer/resources/web_view_internal.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698