| OLD | NEW |
| 1 // Copyright (c) 2009 The chrome Authors. All rights reserved. | 1 // Copyright (c) 2009 The chrome 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 script contains privileged chrome extension related javascript APIs. | 5 // This script contains privileged chrome extension related javascript APIs. |
| 6 // It is loaded by pages whose URL has the chrome-extension protocol. | 6 // It is loaded by pages whose URL has the chrome-extension protocol. |
| 7 | 7 |
| 8 var chrome = chrome || {}; | 8 var chrome = chrome || {}; |
| 9 (function() { | 9 (function() { |
| 10 native function GetExtensionAPIDefinition(); | 10 native function GetExtensionAPIDefinition(); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 return GetL10nMessage(message_name, placeholders); | 418 return GetL10nMessage(message_name, placeholders); |
| 419 } | 419 } |
| 420 | 420 |
| 421 apiFunctions["experimental.popup.show"].handleRequest = | 421 apiFunctions["experimental.popup.show"].handleRequest = |
| 422 function(url, showDetails, callback) { | 422 function(url, showDetails, callback) { |
| 423 // Second argument is a transform from HTMLElement to Rect. | 423 // Second argument is a transform from HTMLElement to Rect. |
| 424 var internalSchema = [ | 424 var internalSchema = [ |
| 425 this.definition.parameters[0], | 425 this.definition.parameters[0], |
| 426 { | 426 { |
| 427 type: "object", | 427 type: "object", |
| 428 name: "domAnchor", | 428 name: "showDetails", |
| 429 properties: { | 429 properties: { |
| 430 top: { type: "integer", minimum: 0 }, | 430 domAnchor: { |
| 431 left: { type: "integer", minimum: 0 }, | 431 type: "object", |
| 432 width: { type: "integer", minimum: 0 }, | 432 properties: { |
| 433 height: { type: "integer", minimum: 0 } | 433 top: { type: "integer", minimum: 0 }, |
| 434 left: { type: "integer", minimum: 0 }, |
| 435 width: { type: "integer", minimum: 0 }, |
| 436 height: { type: "integer", minimum: 0 } |
| 437 } |
| 438 }, |
| 439 giveFocus: { |
| 440 type: "boolean", |
| 441 optional: true |
| 442 } |
| 434 } | 443 } |
| 435 }, | 444 }, |
| 436 this.definition.parameters[2] | 445 this.definition.parameters[2] |
| 437 ]; | 446 ]; |
| 438 return sendRequest(this.name, | 447 return sendRequest(this.name, |
| 439 [url, | 448 [url, |
| 440 getAbsoluteRect(showDetails.relativeTo), | 449 { |
| 450 domAnchor: getAbsoluteRect(showDetails.relativeTo), |
| 451 giveFocus: showDetails.giveFocus |
| 452 }, |
| 441 callback], | 453 callback], |
| 442 internalSchema); | 454 internalSchema); |
| 443 } | 455 } |
| 444 | 456 |
| 445 apiFunctions["experimental.extension.getPopupView"].handleRequest = | 457 apiFunctions["experimental.extension.getPopupView"].handleRequest = |
| 446 function() { | 458 function() { |
| 447 return GetPopupView(); | 459 return GetPopupView(); |
| 448 } | 460 } |
| 449 | 461 |
| 450 apiFunctions["experimental.popup.getParentWindow"].handleRequest = | 462 apiFunctions["experimental.popup.getParentWindow"].handleRequest = |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 AUTO_SUBFRAME: 3, | 551 AUTO_SUBFRAME: 3, |
| 540 MANUAL_SUBFRAME: 4, | 552 MANUAL_SUBFRAME: 4, |
| 541 GENERATED: 5, | 553 GENERATED: 5, |
| 542 START_PAGE: 6, | 554 START_PAGE: 6, |
| 543 FORM_SUBMIT: 7, | 555 FORM_SUBMIT: 7, |
| 544 RELOAD: 8, | 556 RELOAD: 8, |
| 545 KEYWORD: 9, | 557 KEYWORD: 9, |
| 546 KEYWORD_GENERATED: 10 | 558 KEYWORD_GENERATED: 10 |
| 547 }; | 559 }; |
| 548 })(); | 560 })(); |
| OLD | NEW |