summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions
Commit message (Collapse)AuthorAgeFilesLines
* share extension API test frameworkerikkay@chromium.org2009-08-313-0/+16
| | | | | | | | | BUG=18442 TEST=ExtensionApiTest.* Review URL: http://codereview.chromium.org/173622 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24892 0039d316-1c4b-4281-b951-d872f2087c98
* Make a bunch of backlogged breaking changes to the extensions API in prep ↵aa@chromium.org2009-08-281-27/+1
| | | | | | | | | | | | | | | for dev: * Enforce permissions on cross-origin XHR * Enforce module-level permissions * Decided not to completely remove chrome.self since it is so widely used, but removed all references to it from samples and docs. BUG=16356,12129,12140 TEST=Sample extensions on http://dev.chromium.org/developers/design-documents/extensions/samples should still work Review URL: http://codereview.chromium.org/179027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24816 0039d316-1c4b-4281-b951-d872f2087c98
* Extension API Renaming/Consistency changesrafaelw@chromium.org2009-08-281-21/+35
| | | | | | | | BUG=20288 Review URL: http://codereview.chromium.org/180016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24770 0039d316-1c4b-4281-b951-d872f2087c98
* Try again to commit r24174: Change the way json_schema.js is loaded.aa@chromium.org2009-08-255-5/+69
| | | | | | TBR=mpcomplete@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24224 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r24217.aa@chromium.org2009-08-254-56/+2
| | | | | | TBR=mpcomplete@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24218 0039d316-1c4b-4281-b951-d872f2087c98
* Change the way json_schema.js is loaded. This is required soaa@chromium.org2009-08-254-2/+56
| | | | | | | | | | that ChromeOS can use extension-style bindings without polluting the global scope of webpages. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=24174 Review URL: http://codereview.chromium.org/173263 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24217 0039d316-1c4b-4281-b951-d872f2087c98
* Revert breakage from r24174.aa@chromium.org2009-08-243-55/+1
| | | | | | TBR=tony@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24175 0039d316-1c4b-4281-b951-d872f2087c98
* Change the way json_schema.js is loaded. This is required soaa@chromium.org2009-08-243-1/+55
| | | | | | | | that ChromeOS can use extension-style bindings without polluting the global scope of webpages. Review URL: http://codereview.chromium.org/173263 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24174 0039d316-1c4b-4281-b951-d872f2087c98
* Implement granular cross-origin XHR for extensions.aa@chromium.org2009-08-232-5/+28
| | | | | | | | | | | | | I left the temporary hack that allows all origins until we are ready to break everything all at once. Also, I still need to devise some way to test this. BUG=12129 Review URL: http://codereview.chromium.org/173166 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24089 0039d316-1c4b-4281-b951-d872f2087c98
* Validation of extension api callbacks and event parameters in DEBUGrafaelw@chromium.org2009-08-226-13/+49
| | | | | | | | BUG=18711 Review URL: http://codereview.chromium.org/173034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24068 0039d316-1c4b-4281-b951-d872f2087c98
* Async extension callbacks now always fire and set chrome.extension.lastError ↵rafaelw@chromium.org2009-08-181-1/+1
| | | | | | | | | | | | on error. Includes doc changes for extension.lastError and a browsertest. BUG=17381 Review URL: http://codereview.chromium.org/172078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23676 0039d316-1c4b-4281-b951-d872f2087c98
* Implementation of getBackgroundPage(), getToolstrips(), andaa@chromium.org2009-08-142-17/+61
| | | | | | | | | | | | | | | getTabContentses(). This lands http://codereview.chromium.org/159067. Raf, the only thing you need to look at is the changes to extensions_process_bindings.js and extension_api.json. BUG=13577 TEST=Browser tests added Review URL: http://codereview.chromium.org/164458 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23422 0039d316-1c4b-4281-b951-d872f2087c98
* I have taken over this patch, original authored by Adam Hunter (adamhunter).rafaelw@chromium.org2009-08-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | The original issue is: http://codereview.chromium.org/144019 -------------- Functionality has been requested in the Extension API for Javascript to take screenshots of the currently visible tab. This changelist builds this function, chrome.tabs.getVisibleScreenCapture. This function takes a single callback function and returns to that function a data URL of a JPEG image of the current screen. A simple sample extension is provided as a use case. BUG=14760 TEST=There is an extension in chrome\test\data\extensions\samples\screenshot, load this extension. It creates a toolstrip button. Click this button, you should get a page with a screenshot of the active tab. The API function is found at chrome.tabs.getVisibleScreenCapture. Review URL: http://codereview.chromium.org/160228 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23259 0039d316-1c4b-4281-b951-d872f2087c98
* Allow extensions to use APIs that they didn't ask permission to use.mpcomplete@chromium.org2009-08-122-2/+12
| | | | | | | | | BUG=no TEST=no Review URL: http://codereview.chromium.org/165408 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23245 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to WebFrame from the WebKit API.darin@chromium.org2009-08-105-19/+25
| | | | | | | | | | | | | | | I tried to avoid unnecessary changes in this CL to help make it easier to review. As part of this CL, glue/webtextinput* are folded into WebFrame / WebFrameImpl. R=dglazkov BUG=10034 TEST=none Review URL: http://codereview.chromium.org/164225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22896 0039d316-1c4b-4281-b951-d872f2087c98
* Add module-level permissions to extensions.mpcomplete@chromium.org2009-08-073-14/+128
| | | | | | | | | | | | | | This first pass is fairly simple. If a permission is not specified in the manifest, the corresponding module will not be exposed to script. For example, without specifying the "tabs" permission, chrome.tabs and chrome.windows will not be available. BUG=12140 TEST=no Review URL: http://codereview.chromium.org/164039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22745 0039d316-1c4b-4281-b951-d872f2087c98
* Support for referenced schema types in json_schema.rafaelw@chromium.org2009-08-051-0/+5
| | | | | | | | Schema types can be referenced with "$ref" to either internal types or explicitly added types via addTypes() that define their typename via an "id" property. Review URL: http://codereview.chromium.org/159868 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22451 0039d316-1c4b-4281-b951-d872f2087c98
* mole API - take 2erikkay@chromium.org2009-08-041-0/+41
| | | | | | | | | | originally reviewed / committed as http://codereview.chromium.org/160276 TBR=mpcomplete,phadjan.jr Review URL: http://codereview.chromium.org/159854 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22382 0039d316-1c4b-4281-b951-d872f2087c98
* Rolling back change 22245.chrome-bot@google.com2009-08-021-41/+0
| | | | | | | | | | | | Too much red :-( BUG=None TEST=None TBR=erikkay Review URL: http://codereview.chromium.org/159763 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22247 0039d316-1c4b-4281-b951-d872f2087c98
* mole expand/collapse API, callable from a toolstrip for manual operationerikkay@chromium.org2009-08-011-0/+41
| | | | | | Review URL: http://codereview.chromium.org/160276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22245 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a crash that was caused by a NULL entry in the PendingRequestMap.mpcomplete@chromium.org2009-07-301-5/+7
| | | | | | | | | BUG=no TEST=no Review URL: http://codereview.chromium.org/159662 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22121 0039d316-1c4b-4281-b951-d872f2087c98
* Add a WebKit API that registers a V8 extension to be loaded into contentmpcomplete@chromium.org2009-07-303-3/+6
| | | | | | | | | | | scripts. BUG=11797 TEST=no Review URL: http://codereview.chromium.org/159542 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22091 0039d316-1c4b-4281-b951-d872f2087c98
* Remove dependencies on the bug-bait V8Proxy::context() API. No behavior change.abarth@chromium.org2009-07-301-2/+2
| | | | | | Review URL: http://codereview.chromium.org/159628 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22045 0039d316-1c4b-4281-b951-d872f2087c98
* Fix port disconnect so that it's refcounted. This fixes a bug where a channelmpcomplete@chromium.org2009-07-271-1/+44
| | | | | | | | | | | would close if any one listener on the channel called "disconnect()". BUG=16644 TEST=no Review URL: http://codereview.chromium.org/155476 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21678 0039d316-1c4b-4281-b951-d872f2087c98
* Push bookmarks.remove/removeAll polymorphism into c++. fix bookmarks id ↵rafaelw@chromium.org2009-07-241-22/+22
| | | | | | | | | | | schema issues (http://code.google.com/p/chromium/issues/detail?id=17562 failed to update schema types from int to string). R=erikkay BUG=17417 Review URL: http://codereview.chromium.org/160064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21503 0039d316-1c4b-4281-b951-d872f2087c98
* Another try at enabling the content script messaging test.mpcomplete@chromium.org2009-07-241-12/+13
| | | | | | | | | | | | | Also fixes some issues that that test exposes. My previous attempt (http://src.chromium.org/viewvc/chrome?view=rev&revision=21324) was reverted. TEST=no BUG=no Review URL: http://codereview.chromium.org/160048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21483 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix an issue with unregistering content script contexts."mpcomplete@chromium.org2009-07-221-13/+12
| | | | | | | | | | | | browser_tests are not happy. TBR=aa BUG=no TEST=no Review URL: http://codereview.chromium.org/159243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21340 0039d316-1c4b-4281-b951-d872f2087c98
* Fix an issue with unregistering content script contexts.mpcomplete@chromium.org2009-07-221-12/+13
| | | | | | | | | | | Reenable content script messaging test. BUG=no TEST=no Review URL: http://codereview.chromium.org/155887 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21324 0039d316-1c4b-4281-b951-d872f2087c98
* Step 2 in abstracting Extension APIs to shared "IDL".rafaelw@chromium.org2009-07-221-1/+9
| | | | | | | | | | In this step, all "normal" async extension apis have been pulled out into extension_api.json which is loaded in the renderer, and dynamic bindings are created for extension functions & events in extension_process_bindings.js. R=aa Review URL: http://codereview.chromium.org/155741 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21313 0039d316-1c4b-4281-b951-d872f2087c98
* Don't dispatch the extensions bindings unload event during GC.mpcomplete@chromium.org2009-07-211-12/+26
| | | | | | | | | BUG=17289 TEST=no Review URL: http://codereview.chromium.org/159095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21197 0039d316-1c4b-4281-b951-d872f2087c98
* Changed the extension.connect() API not to broadcast to all tabs. Added ampcomplete@chromium.org2009-07-206-23/+89
| | | | | | | | | | | | | more specific tabs.connect(tabId) API to connect to a specific tab. Also changed the ExtensionMessageService from a singleton to a Profile-owned object. BUG=12461 TEST=no Review URL: http://codereview.chromium.org/155707 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21102 0039d316-1c4b-4281-b951-d872f2087c98
* First step in abstracting extension api to common/shared "IDL" files ↵rafaelw@chromium.org2009-07-162-44/+47
| | | | | | | | | | | | | | (jsonschema). In this step, All "normal" api calls and events (those that arrive or originate from the browser process) are routed through a single v8::Extension API Call ("StartRequest"). Additionally, internal string names for methods and events now match the js namespace (i.e. "RemoveTab" -> "tabs.remove"), in anticipation of having names be implicit from their api module & name in the api "IDL". TBR=aa,mpcomplete Review URL: http://codereview.chromium.org/149730 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20910 0039d316-1c4b-4281-b951-d872f2087c98
* Change getLanguage to detectLanguage, and incorporate corresponding changes, ↵sidchat@google.com2009-07-161-6/+6
| | | | | | | | | | in tab extensions. Also, use ISO language (e.g. "fr" instead of "French") as return language. BUG=none TEST=Enable extensions, add the given toolstrip as extension. For a page, the language of the page should be returned as ISO language (e.g., "french" as "fr") Review URL: http://codereview.chromium.org/149627 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20895 0039d316-1c4b-4281-b951-d872f2087c98
* Retrying this patch. This was already reviewed by mpcomplete and thefinnur@chromium.org2009-07-153-8/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only change is a fix for the UI test that broke and a small change to event_bindings.cc (reviewed in-person). ExtensionFunctionDispatcher now notifies ExtensionProcessManager of renderviews created, which in turn notifies the renderer of page actions that it knows about. Remove generic event "page-action-executed" in favor of page action specific event (sent as extension_id/page_action_id). In the bindings, we now setup events for each page action we know about so we can register for specific events, and not receive broadcast events from all page actions. To setup these events I added a GetCurrentPageActions() to extension_process_bindings.cc and a helper function GetCurrentExtensionId(). And, finally, I simplified the page action background page by removing the check to see if we are already subscribed to the feed (since we now support multiple feed readers, it doesn't make sense anymore to always check Google Reader). This check might make a comeback later in a different form. TBR=mpcomplete BUG=13936 TEST=The RSS sample extension should work as before. Review URL: http://codereview.chromium.org/149683 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20782 0039d316-1c4b-4281-b951-d872f2087c98
* Various minor fixes:aa@chromium.org2009-07-151-86/+0
| | | | | | | | | | | | | | | | * --load-extension no longer requires --enable-extensions * No longer support chrome:// URLs for user scripts * Remove old unused Greasemonkey test * Enable Greasemonkey API emulation in linux/mac BUG=16720,16007,4476 TEST=Added several unit tests Original review: http://codereview.chromium.org/149619 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20719 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 20714.finnur@chromium.org2009-07-152-58/+3
| | | | | | | Rietveld showed all green try bots, but looks like one ui test is failing Review URL: http://codereview.chromium.org/149668 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20715 0039d316-1c4b-4281-b951-d872f2087c98
* EFD now notifies EPM of renderviews created, which in turn notifies the ↵finnur@chromium.org2009-07-152-3/+58
| | | | | | | | | | | | | | | | renderer of page actions that it knows about. Remove generic event "page-action-executed" in favor of page action specific event (sent as extension_id/page_action_id). In the bindings, we now setup events for each page action we know about so we can register for specific events, and not receive broadcast events from all page actions. To setup these events I added a GetCurrentPageActions() to extension_process_bindings.cc and a helper function GetCurrentExtensionId(). And, finally, I simplified the page action background page by removing the check to see if we are already subscribed to the feed (since we now support multiple feed readers, it doesn't make sense anymore to always check Google Reader). This check might make a comeback later in a different form. BUG=13936 TEST=The RSS sample extension should work as before. Review URL: http://codereview.chromium.org/155514 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20714 0039d316-1c4b-4281-b951-d872f2087c98
* Chrome-side of fixes for content-script messaging.mpcomplete@chromium.org2009-07-142-28/+73
| | | | | | | | | | | | | | | | | | This change adds registration of content scripts, parented to a frame's context. When a frame's context goes away, we unregister it and any content script contexts for it. There's a corresponding webkit change that lets us know when a content script context is created. Filed upstream as https://bugs.webkit.org/show_bug.cgi?id=27104. BUG=16228 TEST=install an extension with a content script that communicates with a parent process. Messages should be sendable both ways. Review URL: http://codereview.chromium.org/155309 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20677 0039d316-1c4b-4281-b951-d872f2087c98
* Add an optional channel name to the extension message connect event.mpcomplete@chromium.org2009-07-131-2/+3
| | | | | | | | | | | Also changed the way port IDs work internally to reduce confusion. Each end of the port has its own ID, not the ID of its opposite end. BUG=13706 TEST=no Review URL: http://codereview.chromium.org/155381 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20519 0039d316-1c4b-4281-b951-d872f2087c98
* Add getLanguage function to tab extension.sidchat@google.com2009-07-101-0/+18
| | | | | | | | BUG=none TEST=enable extensions using the toolstip.html code (added with this CL) and load pages in different languages. The corresponding language should appear in the bottom left after the page is loadedm or when the button is clicked, or when you navigate back to that tab after visiting some other tab. Review URL: http://codereview.chromium.org/150062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20378 0039d316-1c4b-4281-b951-d872f2087c98
* Make the API to open a message channel symmetric, so it works the same ↵mpcomplete@chromium.org2009-07-097-71/+68
| | | | | | | | | | | | | | | whether opening from a tab or extension. Also, move the callback handling back to extension_process_bindings, since I didn't need it in event_bindings to implement this, and it didn't make sense there anyway. BUG=12461 TEST=no Review URL: http://codereview.chromium.org/149237 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20296 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some issues with extension messaging:mpcomplete@chromium.org2009-07-021-1/+4
| | | | | | | | | | | | | | - Disconnect ports properly (javascript mistake). - Use the right port ID when dispatching the disconnect event. - Fix a bug with 2 extensions loaded in the same process. BUG=12686 BUG=15798 TEST=Load an extension that uses messaging, and make sure it disconnects when you navigate or close the connecting. Review URL: http://codereview.chromium.org/152003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19844 0039d316-1c4b-4281-b951-d872f2087c98
* Add a couple of more extension unit tests for pagefinnur@chromium.org2009-07-021-0/+9
| | | | | | | | | | | | | actions. One for the helper function that parses a page action from the manifest and another that tests the page action api. BUG=None TEST=None Review URL: http://codereview.chromium.org/151181 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19840 0039d316-1c4b-4281-b951-d872f2087c98
* Send port disconnect events when a frame is unloaded.mpcomplete@chromium.org2009-07-012-2/+15
| | | | | | | | | | | | This is the other half of CL http://codereview.chromium.org/125280, which I split into http://codereview.chromium.org/147033 and this CL. BUG=12686 TEST=no Review URL: http://codereview.chromium.org/150125 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19686 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor extension bindings to share code, avoid exposing hidden variablesmpcomplete@chromium.org2009-06-308-252/+303
| | | | | | | | | | | | | | | | | globally, and avoid using the DOM load/unload events. - moved callback handling into event_bindings.js (ports will use it). - added chromeHidden, a V8 hidden value, to keep all internal variables that need to be accessible to native code. - changed context registration to occur always at extension load, instead of DOM load. - added an internal unload event that doesn't disable SuddenTermination. This is a rework of my earlier CL http://codereview.chromium.org/125280 which was reverted because of a perf regression. I believe the perf problem was caused by the call into javascript I did on page load to handle context registration - this CL avoids that. Review URL: http://codereview.chromium.org/147033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19634 0039d316-1c4b-4281-b951-d872f2087c98
* Add notifications for when V8Proxy creates or destroys a V8 Context.mpcomplete@chromium.org2009-06-262-0/+22
| | | | | | | | | | BUG=no TEST=no Review URL: http://codereview.chromium.org/147124 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19424 0039d316-1c4b-4281-b951-d872f2087c98
* Adding the ability to remove page actions.BUG=NoneTEST=unit test.finnur@chromium.org2009-06-221-1/+6
| | | | | | Review URL: http://codereview.chromium.org/131003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18910 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 18765 to try to repair perf regressionjar@chromium.org2009-06-195-49/+17
| | | | | | | TBR=mpcomplete Review URL: http://codereview.chromium.org/131093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18784 0039d316-1c4b-4281-b951-d872f2087c98
* Send port-closed notification when a frame with ports unloads.mpcomplete@google.com2009-06-185-17/+49
| | | | | | | | | | | | | Also add onLoad and onUnload chrome Event to our bindings, so we can add listeners to these events without needing a DOM. These don't hook into the window "unload" event, so we no longer prevent Chrome's sudden termination of tabs on shutdown. BUG=12686 TEST=no Review URL: http://codereview.chromium.org/125280 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18765 0039d316-1c4b-4281-b951-d872f2087c98
* Add a port disconnect event for when one side of an extension message portmpcomplete@google.com2009-06-172-41/+53
| | | | | | | | | | | | | goes away. Combine the various ExtensionMessageService IPC message into a single "Invoke" message. BUG=12686 TEST=no Review URL: http://codereview.chromium.org/126234 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18645 0039d316-1c4b-4281-b951-d872f2087c98