summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_menu_manager.cc
Commit message (Collapse)AuthorAgeFilesLines
* Make NotificationService an interface in the content namespace, and switch ↵jam@chromium.org2011-10-191-1/+2
| | | | | | | | | callers to use it. Move the implementation to content/browser. Stop creating it in all child processes since it's only used in the browser. BUG=98716 Review URL: http://codereview.chromium.org/8342048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106403 0039d316-1c4b-4281-b951-d872f2087c98
* Move NotificationObserver, NotificationSource, and NotificationDetails to ↵jam@chromium.org2011-10-191-5/+6
| | | | | | | | | | | content/public/browser. This patch got way bigger than I wanted, but once I moved NotificationDetails, I figured I might as well mvoe the others since they're in the same files. In hindsight, I should have converted a subset of files at a time by leaving a using statement in the header. BUG=98716 TBR=joi git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106196 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some AllSources observers of EXTENSION_UNLOADED.yoz@chromium.org2011-10-131-6/+4
| | | | | | | | | | | | Most such observers use it to remove state they are tracking about particular extensions. extension_menu_manager should be okay even without this. desktop_notification_service might have had subtle wrongness. BUG=99391 TEST=existing tests Review URL: http://codereview.chromium.org/8253005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105390 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ExtensionTabUtil-namespaced functions into their own file.miket@chromium.org2011-09-271-1/+1
| | | | | | | | | TEST=none; no functionality has changed. Review URL: http://codereview.chromium.org/8037005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102958 0039d316-1c4b-4281-b951-d872f2087c98
* content: Move render_widget_host_view_gtk to content/ try 2.erg@google.com2011-08-231-2/+2
| | | | | | | | | | | | | | | | | | | | This was r97750, which was reverted at r97756. This patch, in addition to all the other things it did, marks OwnedWidgetGtk for export and moves it to the ui:: namespace. Original list of things this patch does: - OwnedWidgetGtk now goes in ui/base/gtk/ - TruncateString moved from l10n_util:: to ui:: - GtkIMContextWrapper has part of its code split into chrome/ (IDC using code goes in RenderViewContextMenu) and the rest go in content/ (gtk using code goes with GtkIMContextWrapper). - gtk_key_bindings_handler[_unittest] now goes in content, as it's a utility class to RenderWidgetHostGtk. BUG=93804 TEST=existing unit tests Original Review URL: http://codereview.chromium.org/7669040 Review URL: http://codereview.chromium.org/7708021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97889 0039d316-1c4b-4281-b951-d872f2087c98
* (shlib failure) Revert 97750 - content: Move render_widget_host_view_gtk to ↵erg@google.com2011-08-221-2/+2
| | | | | | | | | | | | | | | | | | | | content/ This also moves some other files: - OwnedWidgetGtk now goes in ui/base/gtk/ - TruncateString moved from l10n_util:: to ui:: - GtkIMContextWrapper has part of its code split into chrome/ (IDC using code goes in RenderViewContextMenu) and the rest go in content/ (gtk using code goes with GtkIMContextWrapper). - gtk_key_bindings_handler[_unittest] now goes in content, as it's a utility class to RenderWidgetHostGtk. BUG=93804 TEST=existing unit tests Review URL: http://codereview.chromium.org/7669040 TBR=erg@google.com Review URL: http://codereview.chromium.org/7708017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97756 0039d316-1c4b-4281-b951-d872f2087c98
* content: Move render_widget_host_view_gtk to content/erg@google.com2011-08-221-2/+2
| | | | | | | | | | | | | | | This also moves some other files: - OwnedWidgetGtk now goes in ui/base/gtk/ - TruncateString moved from l10n_util:: to ui:: - GtkIMContextWrapper has part of its code split into chrome/ (IDC using code goes in RenderViewContextMenu) and the rest go in content/ (gtk using code goes with GtkIMContextWrapper). - gtk_key_bindings_handler[_unittest] now goes in content, as it's a utility class to RenderWidgetHostGtk. BUG=93804 TEST=existing unit tests Review URL: http://codereview.chromium.org/7669040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97750 0039d316-1c4b-4281-b951-d872f2087c98
* some cleanup for base/stl_utildilmah@chromium.org2011-07-191-1/+1
| | | | | | | | | | | | | removed unused/irrelevant functions removed irrelevant comments Moved stl_util-inl.h => stl_util.h BUG=None TEST=None Review URL: http://codereview.chromium.org/7342047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93110 0039d316-1c4b-4281-b951-d872f2087c98
* Remove scheme restriction for extension context menu items.asargent@chromium.org2011-07-141-9/+0
| | | | | | | | | | | BUG=51461, 73631 TEST=Install an extension that adds context menu items - you should now see them on pages with schemes like chrome://, file://, chrome-extension://, etc. Review URL: http://codereview.chromium.org/7258009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92609 0039d316-1c4b-4281-b951-d872f2087c98
* Moving notification types which are chrome specific to a new header file ↵ananta@chromium.org2011-07-101-3/+4
| | | | | | | | | | | | | chrome_notification_types.h. This file lives in chrome\common. The chrome specific notifications start from NOTIFICATION_CONTENT_END which defines the end of the enum used by content to define notification types. The notificaton_type.h file in content\common has been renamed to content_notification_types.h BUG=76698 Review URL: http://codereview.chromium.org/7327007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91972 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Pass parameters by reference.jhawkins@chromium.org2011-03-281-1/+2
| | | | | | | | | | | | CID=6820,8735,11066,11067,11070,11071,11072,11073,11215,11216,11217,11927,12403 BUG=none TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/6730040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79602 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Pass parameters by reference.jhawkins@chromium.org2011-03-281-2/+4
| | | | | | | | | | | | | CID=12947,13008,13087,13144,13280,13479,13480,13574,13575,13576,13580,13594, 13595,14186,14351 BUG=none TEST=none R=csilv@chromium.org Review URL: http://codereview.chromium.org/6733043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79595 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Fix various NULL_RETURNS defects.csilv@chromium.org2011-03-111-1/+3
| | | | | | | | CID=8699, 13592, 14444, 14510, 14658, 14805, 14897 BUG=none Review URL: http://codereview.chromium.org/6672016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77845 0039d316-1c4b-4281-b951-d872f2087c98
* Update a bunch of files to the new location of notification files.tfarina@chromium.org2011-03-081-3/+3
| | | | | | | | | | | First part of the remaining files. BUG=None TEST=None Review URL: http://codereview.chromium.org/6649001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77330 0039d316-1c4b-4281-b951-d872f2087c98
* Change includes of gfx/* to ui/gfx/*sail@chromium.org2011-02-051-1/+1
| | | | | | | | | BUG=71063 TEST=compiled Review URL: http://codereview.chromium.org/6312156 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73890 0039d316-1c4b-4281-b951-d872f2087c98
* Move l10n_util to ui/baseben@chromium.org2011-01-211-1/+1
| | | | | | | | | BUG=none TEST=none TBR=brettw git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72227 0039d316-1c4b-4281-b951-d872f2087c98
* Change extension unload notification to indicate updates.asargent@chromium.org2010-12-231-1/+2
| | | | | | | | | | | | | | | | | | | When an extension in being unloaded, some listeners want to know if it's because the extension is being updated to a newer version, or disabled. This changes the details sent to include a reason. Also this removes the EXTENSION_UNLOADED_DISABLED notification, since only a small number of places actually cared about the disctinction between EXTENSION_UNLOADED and EXTENSION_UNLOADED_DISABLED, and puts that information into the details as well. BUG=65510 TEST=Should be covered by existing unit & browser tests. Review URL: http://codereview.chromium.org/5968009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70104 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove unneeded includes of notification_service.h in other headers.thestig@chromium.org2010-12-151-0/+1
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/5783006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69321 0039d316-1c4b-4281-b951-d872f2087c98
* webkit: use string16 in ContextMenuParamsevan@chromium.org2010-12-141-2/+1
| | | | | | | | | BUG=23581 TEST=compiles Review URL: http://codereview.chromium.org/5712003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69074 0039d316-1c4b-4281-b951-d872f2087c98
* wstrings: make l10n_util::TruncateString use string16evan@chromium.org2010-12-101-4/+2
| | | | | | | | BUG=23581 Review URL: http://codereview.chromium.org/5742006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68875 0039d316-1c4b-4281-b951-d872f2087c98
* Move:ben@chromium.org2010-12-021-1/+1
| | | | | | | | | | | | | | | file_path_watcher into subdir profile* into profiles/ subdir login* into ui/login visitedlink* into subdir BUG=none TEST=none TBR=brettw Review URL: http://codereview.chromium.org/5606002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68069 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug with context menus in incognito mode.mpcomplete@chromium.org2010-11-021-2/+35
| | | | | | | | | | | | | | | | | If an extension uses "spanning" mode, the context menu items are shared between profiles. If an extension uses "split" mode, the items are separate per profile. In either case, they only appear in incognito if the extension is enabled in incognito. Also fixed a minor bug, so that tabs.create now can open extension URLs in incognito if the extension uses split mode. BUG=61147 TEST=see bug for repro steps; context menu items should work in incognito mode Review URL: http://codereview.chromium.org/4090011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64812 0039d316-1c4b-4281-b951-d872f2087c98
* Part 3 of immutable Extension refactor.mpcomplete@chromium.org2010-10-291-2/+2
| | | | | | | | | | | | | Make ExtensionsService hold const Extension pointers only. This ensures that extensions can't be modified after they're created, and lets us share them between threads. BUG=56558 TEST=no functional change Review URL: http://codereview.chromium.org/4138006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64517 0039d316-1c4b-4281-b951-d872f2087c98
* Fix broken icons in new context menu items after removing previous itemsasargent@chromium.org2010-10-281-1/+3
| | | | | | | | | | | | | | BUG=59603 TEST=Have an extension add several context menu items. Verify that the context menu properly shows the extension's icon. Now call chrome.contextMenus.remove repeatedly to remove all the items. Then add one or more new ones. The icon should still show up properly, and not revert to the default puzzle piece icon. Review URL: http://codereview.chromium.org/4170008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64337 0039d316-1c4b-4281-b951-d872f2087c98
* Part 2 of extension event refactor.mpcomplete@chromium.org2010-10-211-3/+3
| | | | | | | | | | | | | Extension events are no longer broadcast to an entire process. They are filtered by extension. This allows me to move the cross-incognito check into the browser, and remove a bunch of cruft associated with that. BUG=58214 TEST=no functional change Review URL: http://codereview.chromium.org/3775015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63448 0039d316-1c4b-4281-b951-d872f2087c98
* Pull events-related code out of ExtensionMessageService into its own class.mpcomplete@chromium.org2010-10-151-4/+5
| | | | | | | | | | | | | | The events code is independent of the messaging code and didn't belong in the same class. This is part 1 of an extension event refactor. See bug for more details. BUG=58214 TEST=covered by tests Review URL: http://codereview.chromium.org/3758005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62764 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for a "split" incognito behavior for extensions.mpcomplete@chromium.org2010-08-311-2/+1
| | | | | | | | | | | | | | | | - On by default for apps, off by default for extensions. - Split mode means "run incognito extensions in a separate process if the user says OK, and the two processes can only see their own profile." - Spanning mode is what we have now, and means "run a single extension process, but allow it to access both profiles if the user says OK." BUG=49232 BUG=49114 TEST=extensions still work in incognito when you check "Allow in Incognito". Review URL: http://codereview.chromium.org/3210007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58033 0039d316-1c4b-4281-b951-d872f2087c98
* Convert more wide strings in browser/extensions.viettrungluu@chromium.org2010-08-141-14/+15
| | | | | | | | | | | | I think this kills off the remaining uses of the now-deprecated wstring DictionaryValue methods. BUG=23581 TEST=builds and passes tests Review URL: http://codereview.chromium.org/3125010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56141 0039d316-1c4b-4281-b951-d872f2087c98
* Update the names of some parameters passed to contextMenu onclick handlers.asargent@chromium.org2010-08-041-4/+4
| | | | | | | | | | | | | | This changes the mediaType parameter values to be lowercase (eg "audio" instead of "AUDIO"), and changes mainFrameUrl to be pageUrl as the design doc had intended. BUG=49725 TEST=In onclick handlers, values for mediaType should be lowercase and there should be a pageUrl property matching the url of the page. Review URL: http://codereview.chromium.org/3017056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54999 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure we fully remove child context menu items when deleting a parent.asargent@chromium.org2010-08-021-16/+23
| | | | | | | | | BUG=49742 TEST=Follow steps in the bug report Review URL: http://codereview.chromium.org/3081009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54628 0039d316-1c4b-4281-b951-d872f2087c98
* Set a max limit on extension items' labels in context menus.asargent@chromium.org2010-08-021-1/+7
| | | | | | | | | | | | | Also do some cleanup of context menu tests, including adding a generic mechanism to let javascript pass a test message and have C++ test code wait for and retrieve those messages. BUG=49744 TEST=Follow steps in bug report Review URL: http://codereview.chromium.org/3017047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54514 0039d316-1c4b-4281-b951-d872f2087c98
* Add ability to limit when context menu items appear with url patterns.asargent@chromium.org2010-07-181-0/+9
| | | | | | | | | BUG=408198 TEST=Extensions context menu API should work with changes described. Review URL: http://codereview.chromium.org/2811049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52867 0039d316-1c4b-4281-b951-d872f2087c98
* Use the extension icon for extension omnibox results instead of the genericmpcomplete@chromium.org2010-07-151-75/+9
| | | | | | | | | | | | | | | search icon. I refactored the extension menu manager to separate the icon-specific bits. BUG=46479 TEST=load the chrome search extension at src/chrome/common/extensions/docs/examples/extensions/chrome_search/ and type "src foo" into the omnibox. You should see the extension icon instead of the magnifying glass. Switch back and forth between the "src" keyword result, other results, and other keywords and the icons should update properly. Review URL: http://codereview.chromium.org/2973006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52535 0039d316-1c4b-4281-b951-d872f2087c98
* More cleanup of extensions context menu API.asargent@chromium.org2010-07-141-58/+61
| | | | | | | | | | | | | | | | | | | This changes the contextMenus.create method to synchronously return an id instead of aysynchronously in the callback. This meant moving the generating of id's from a globally unique integer in C++ code to an extension-unique integer in javascript. The C++ unique id thus becomes a pair of <extension_id,int>. Also a couple of small drive-by cleanups while I was in some of the files. BUG=48198 TEST=The context menu API should work normally, given the changes described above. Review URL: http://codereview.chromium.org/2911007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52384 0039d316-1c4b-4281-b951-d872f2087c98
* Some cleanup of the extensions context menu API. asargent@chromium.org2010-07-091-4/+2
| | | | | | | | | | | | | | | | | | This CL contains the following: -Use lower case names for enum values in the create/update properties (eg 'page' instead of 'PAGE') -Make the top-level API name plural (contextMenus instead of contextMenu) -Don't fire onclick handlers for a parent menu item when one of its children is clicked on. -Remove the enabledContexts property for now, to eventually be replaced with a way to programmatically enable/disable. There are a few more things in the bug that I'll be doing in subsequent CL's. BUG=48198 TEST=Extensions using the context menu API should work with the changes described above. Review URL: http://codereview.chromium.org/2887013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51970 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert "Show extension icons next to their top-level context menu ↵hclam@chromium.org2010-06-251-6/+95
| | | | | | | | | | | items."" This reverts r50828 as the error is already suppressed r50793. TBR=asargent Review URL: http://codereview.chromium.org/2844028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50831 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r50779 as it breaks memory testshclam@chromium.org2010-06-251-95/+6
| | | | | | | | | TBR=asargent@chromium.org TEST=Tree goes green Review URL: http://codereview.chromium.org/2812025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50828 0039d316-1c4b-4281-b951-d872f2087c98
* Show extension icons next to their top-level context menu items.asargent@chromium.org2010-06-241-6/+95
| | | | | | | | | | | | | | | Also fix a bug in extension icon caching where we weren't keeping track of potential resizing done by ImageLoadingTracker before setting the cached SkBitmap. BUG=39494 TEST=Install an extension that includes an icon and uses the experimental context menu API. You should see the extension's icon in the context menu next to its top-level item. Review URL: http://codereview.chromium.org/2867008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50779 0039d316-1c4b-4281-b951-d872f2087c98
* Fix submenu support for extensions context menu API.asargent@chromium.org2010-06-031-60/+27
| | | | | | | | | | | | | | | | This fixes submenus which broke on all platforms during a recent refactor of the RenderViewContextMenu class, and adds support for more than one level of child menus. BUG=39504 TEST=Create a test extension using the chrome.experimental.contextMenu API and add multiple levels of child menu items. Review URL: http://codereview.chromium.org/2443002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48892 0039d316-1c4b-4281-b951-d872f2087c98
* Add update and removeAll functions to extensions context menu APIasargent@chromium.org2010-05-121-20/+138
| | | | | | | | | | BUG=39505 TEST=Should be able to add a bunch of context menu items and then change or remove them using update and removeAll respectively. Review URL: http://codereview.chromium.org/1736028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47060 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 44348 Add support for restricting broadcasting events to extensions ↵jochen@chromium.org2010-04-141-1/+1
| | | | | | | | | | | | based on host permissions BUG=38398 TEST=none TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/1528038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44470 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 44351 - Reland 44348 Add support for restricting broadcasting events ↵jochen@chromium.org2010-04-131-1/+1
| | | | | | | | | | | | | | | to extensions based on host permissions BUG=38398 TEST=none TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/1642005 TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/1521027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44355 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 44348 Add support for restricting broadcasting events to extensions ↵jochen@chromium.org2010-04-131-1/+1
| | | | | | | | | | | | based on host permissions BUG=38398 TEST=none TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/1642005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44351 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 44348 - Add support for restricting broadcasting events to extensions ↵jochen@chromium.org2010-04-131-1/+1
| | | | | | | | | | | | | | based on host permissions. BUG=38398 TEST=none Review URL: http://codereview.chromium.org/1095002 TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/1575036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44349 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for restricting broadcasting events to extensions based on host ↵jochen@chromium.org2010-04-131-1/+1
| | | | | | | | | | | permissions. BUG=38398 TEST=none Review URL: http://codereview.chromium.org/1095002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44348 0039d316-1c4b-4281-b951-d872f2087c98
* Initial version of an experimental Extensions Context Menu API.asargent@chromium.org2010-03-231-0/+339
The proposal for the API is documented at: http://dev.chromium.org/developers/design-documents/extensions/context-menu-api Notable limitations in this initial implementation: -No reliable way to get at the unique, actual node clicked on in contexts like IMAGE/LINK/etc. We'll need to fix this in the long run - see the API proposal page for some notes on this. -No update or deleteAll methods ; the only way you can change items is to delete by id and re-add. -We aren't yet matching the UI goal of having the extension items at the top level include the extension icon on the left. This will require a refactoring of RenderViewContextMenu to steal some of the code from the bookmarks bar context menus, which can display favicons. -The only kind of parent->child menu that currently works is if you have a single top-level parent, and only one level of children. (This is because of how RenderViewContextMenu currently works) -No browser tests that the menu items actually get drawn (will wait on those until the above mentioned refactor is complete), or API tests (the API may change a bit based on feedback, at which point I'll write more tests). -Unit tests need to cover some more cases. BUG=32363 TEST=Should be able to create context menus with this API. Review URL: http://codereview.chromium.org/1042003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42321 0039d316-1c4b-4281-b951-d872f2087c98