Add testing/scripts/OWNERS
[chromium-blink-merge.git] / chrome / renderer / resources / extensions / identity_custom_bindings.js
blobf595df1289adcda68fb3737d703118be6ccddd1b
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Custom binding for the Identity API.
7 var binding = require('binding').Binding.create('identity');
9 binding.registerCustomHook(function(binding, id, contextType) {
10   var apiFunctions = binding.apiFunctions;
11   var identity = binding.compiledApi;
13   apiFunctions.setHandleRequest('getRedirectURL', function(path) {
14     if (path === null || path === undefined)
15       path = '/';
16     else
17       path = String(path);
18     if (path[0] != '/')
19       path = '/' + path;
20     return 'https://' + id + '.chromiumapp.org' + path;
21   });
22 });
24 exports.binding = binding.generate();