diff options
author | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-08 04:28:58 +0000 |
---|---|---|
committer | twiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-08 04:28:58 +0000 |
commit | bf7e9637d7935075e56bd3d15df864f78312df53 (patch) | |
tree | 30ee46ce46c99585a43f9dc06788e69772f18bd1 /chrome/renderer/resources | |
parent | e36ddc88da9374cfa6853101b2b81eb20a081026 (diff) | |
download | chromium_src-bf7e9637d7935075e56bd3d15df864f78312df53.zip chromium_src-bf7e9637d7935075e56bd3d15df864f78312df53.tar.gz chromium_src-bf7e9637d7935075e56bd3d15df864f78312df53.tar.bz2 |
Addition of a new parameter to the popup.show(...) Chrome extension API that allows the caller to specify the behaviour of the window focus when the pop-up is displayed.
I added a test for the new parameter in the ExtensionApiTest.FLAKY_Popup test. I also corrected a truncated string in the unit-test.
Because the pop-up actually uses two windows, I had to change the WidgetWin::Show() routine to also reposition the window at the top. If a window is shown and activated, it is automatically brought to the front. Because we don't activate the pop-up when we want to keep the focus in the current extension view, I had to bring it to the front so that it wouldn't be hidden behind the 'chrome-bubble' window.
BUG=none
TEST=ExtensionApiTest.FLAKY_Popup
Review URL: http://codereview.chromium.org/454019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/resources')
-rw-r--r-- | chrome/renderer/resources/extension_process_bindings.js | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/chrome/renderer/resources/extension_process_bindings.js b/chrome/renderer/resources/extension_process_bindings.js index 2fdaad7..7d8cac8 100644 --- a/chrome/renderer/resources/extension_process_bindings.js +++ b/chrome/renderer/resources/extension_process_bindings.js @@ -425,19 +425,31 @@ var chrome = chrome || {}; this.definition.parameters[0], { type: "object", - name: "domAnchor", + name: "showDetails", properties: { - top: { type: "integer", minimum: 0 }, - left: { type: "integer", minimum: 0 }, - width: { type: "integer", minimum: 0 }, - height: { type: "integer", minimum: 0 } + domAnchor: { + type: "object", + properties: { + top: { type: "integer", minimum: 0 }, + left: { type: "integer", minimum: 0 }, + width: { type: "integer", minimum: 0 }, + height: { type: "integer", minimum: 0 } + } + }, + giveFocus: { + type: "boolean", + optional: true + } } }, this.definition.parameters[2] ]; return sendRequest(this.name, [url, - getAbsoluteRect(showDetails.relativeTo), + { + domAnchor: getAbsoluteRect(showDetails.relativeTo), + giveFocus: showDetails.giveFocus + }, callback], internalSchema); } |