chrome 100 percent

chrome 100 percent


DisciplinaPedagogia116.833 materiais673.543 seguidores
Pré-visualização50 páginas
== 0)) {
 console.error('Error: "filename" parameter to suggest() must be a ' +
 'non-empty string');
 return false;
 } else if ([undefined, 'uniquify', 'overwrite', 'prompt'].indexOf(
 result.conflictAction) < 0) {
 console.error('Error: &quot;conflictAction&quot; parameter to suggest() must be ' +
 'one of undefined, &quot;uniquify&quot;, &quot;overwrite&quot;, &quot;prompt&quot;');
 return false;
 }
 return true;
 }
 function suggestCallback(result) {
 if (!suggestable) {
 console.error('suggestCallback may not be called more than once.');
 return;
 }
 suggestable = false;
 if (isValidResult(result)) {
 downloadsInternal.determineFilename(
 downloadId, result.filename, result.conflictAction || &quot;&quot;);
 } else {
 downloadsInternal.determineFilename(downloadId, &quot;&quot;, &quot;&quot;);
 }
 }
 try {
 var results = dispatch([downloadItem, suggestCallback]);
 var async = (results &&
 results.results &&
 (results.results.length != 0) &&
 (results.results[0] === true));
 if (suggestable && !async)
 suggestCallback();
 } catch (e) {
 suggestCallback();
 throw e;
 }
});
if (!apiBridge)
 exports.$set('binding', binding.generate());
// Copyright 2017 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.
var Event = require('event_bindings').Event;
// The EasyUnlockProximityRequired object is just a stub that has an onChange
// event, which is never triggered.
// TODO(devlin): Remove this once the preferencesPrivate API is fully removed.
// https://crbug.com/593166
function EasyUnlockProximityRequired(prefKey, valueSchema, schema) {
 // Note: technically, extensions could intercept this through a setter on
 // Object.prototype(). We don't really care, because a) this is only for a
 // private API, so we shouldn't have to worry about untrusted code, and b)
 // this is an anonymous event, which exposes no attack surface and will be
 // exposed to the extension anyway.
 this.onChange = new Event();
};
exports.$set('EasyUnlockProximityRequired', EasyUnlockProximityRequired);
// Copyright 2013 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 bindings for the feedbackPrivate API.
var binding = apiBridge || require('binding').Binding.create('feedbackPrivate');
var blobNatives = requireNative('blob_natives');
binding.registerCustomHook(function(bindingsAPI) {
 var apiFunctions = bindingsAPI.apiFunctions;
 apiFunctions.setUpdateArgumentsPostValidate(
 &quot;sendFeedback&quot;, function(feedbackInfo, callback) {
 var attachedFileBlobUuid = '';
 var screenshotBlobUuid = '';
 if (feedbackInfo.attachedFile)
 attachedFileBlobUuid =
 blobNatives.GetBlobUuid(feedbackInfo.attachedFile.data);
 if (feedbackInfo.screenshot)
 screenshotBlobUuid =
 blobNatives.GetBlobUuid(feedbackInfo.screenshot);
 feedbackInfo.attachedFileBlobUuid = attachedFileBlobUuid;
 feedbackInfo.screenshotBlobUuid = screenshotBlobUuid;
 return [feedbackInfo, callback];
 });
});
if (!apiBridge)
 exports.$set('binding', binding.generate());
// Copyright 2013 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 GCM API.
var binding = apiBridge || require('binding').Binding.create('gcm');
var forEach = require('utils').forEach;
binding.registerCustomHook(function(bindingsAPI) {
 var apiFunctions = bindingsAPI.apiFunctions;
 var gcm = bindingsAPI.compiledApi;
 apiFunctions.setUpdateArgumentsPostValidate(
 'send', function(message, callback) {
 // Validate message.data.
 var payloadSize = 0;
 forEach(message.data, function(property, value) {
 if (property.length == 0)
 throw new Error(&quot;One of data keys is empty.&quot;);
 var lowerCasedProperty = property.toLowerCase();
 // Issue an error for forbidden prefixes of property names.
 if (lowerCasedProperty.startsWith(&quot;goog.&quot;) ||
 lowerCasedProperty.startsWith(&quot;google&quot;) ||
 property.startsWith(&quot;collapse_key&quot;)) {
 throw new Error(&quot;Invalid data key: &quot; + property);
 }
 payloadSize += property.length + value.length;
 });
 if (payloadSize > gcm.MAX_MESSAGE_SIZE)
 throw new Error(&quot;Payload exceeded allowed size limit. Payload size is: &quot;
 + payloadSize);
 if (payloadSize == 0)
 throw new Error(&quot;No data to send.&quot;);
 return arguments;
 });
});
if (!apiBridge)
 exports.$set('binding', binding.generate());
// Copyright 2013 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 Identity API.
var binding = apiBridge || require('binding').Binding.create('identity');
binding.registerCustomHook(function(binding, id, contextType) {
 var apiFunctions = binding.apiFunctions;
 apiFunctions.setHandleRequest('getRedirectURL', function(path) {
 if (path === null || path === undefined)
 path = '/';
 else
 path = String(path);
 if (path[0] != '/')
 path = '/' + path;
 return 'https://' + id + '.chromiumapp.org' + path;
 });
});
if (!apiBridge)
 exports.$set('binding', binding.generate());
// Copyright 2013 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 image writer private API.
var binding =
 apiBridge || require('binding').Binding.create('imageWriterPrivate');
binding.registerCustomHook(function(bindingsAPI) {
 var apiFunctions = bindingsAPI.apiFunctions;
 apiFunctions.setUpdateArgumentsPostValidate(
 'writeFromFile', function(device, fileEntry, options, callback) {
 var fileSystemName = fileEntry.filesystem.name;
 var relativePath = $String.slice(fileEntry.fullPath, 1);
 return [device, fileSystemName, relativePath, callback];
 });
});
if (!apiBridge)
 exports.$set('binding', binding.generate());
// Copyright (c) 2012 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 input ime API. Only injected into the
// v8 contexts for extensions which have permission for the API.
var binding = apiBridge || require('binding').Binding.create('input.ime');
var appWindowNatives = requireNative('app_window_natives');
var registerArgumentMassager = bindingUtil ?
 $Function.bind(bindingUtil.registerEventArgumentMassager, bindingUtil) :
 require('event_bindings').registerArgumentMassager;
// TODO(crbug.com/733825): These bindings have some issues.
var inputIme;
registerArgumentMassager('input.ime.onKeyEvent',
 function(args, dispatch) {
 var keyData = args[1];
 var result = false;
 try {
 // dispatch() is weird - it returns an object {results: array<results>} iff
 // there is at least one result value that !== undefined. Since onKeyEvent
 // has a maximum of one listener, we know that any result we find is the one
 // we're interested in.
 var dispatchResult = dispatch(args);
 if (dispatchResult && dispatchResult.results)
 result = dispatchResult.results[0];
 } catch (e) {
 console.error('Error in event handler for onKeyEvent: ' + e.stack);
 }
 if (!inputIme.onKeyEvent.async)
 inputIme.keyEventHandled(keyData.requestId, result);
});
binding.registerCustomHook(function(api)