summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/menu_gtk.h
Commit message (Collapse)AuthorAgeFilesLines
* GTK: Use page and app menu models.estade@chromium.org2010-01-071-12/+16
| | | | | | | | | | | | | | | - implement more MenuModel support for MenuGtk - copy some accelerators around TODO: centralize accelerator list (currently they are all listed twice) TODO: get rid of standard_menus.cc (it is still used by the popup favicon menu) BUG=NONE TEST=page and app menus still work, still display accelerators, accelerators still work Review URL: http://codereview.chromium.org/523105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35671 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: make tab context menu use tab_menu_modelestade@chromium.org2010-01-051-0/+1
| | | | | | | | | | | flesh out some more menu model implementation for MenuGtk BUG=28977 TEST=menu still works as before Review URL: http://codereview.chromium.org/523049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35569 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: fix regression where MenuGtk::Delegate GetLabel() method was ↵estade@chromium.org2010-01-051-0/+3
| | | | | | | | | | | | | erroneously removed. got overzealous deleting code in r35389 BUG=31391 TEST=see bug git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35502 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Remove OwnedWidgetGtk wrapper for the GtkMenu* in MenuGtk.estade@chromium.org2009-12-311-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "execute the command later" workaround, which was in place to avoid OwnedWidget-DCHECKing when selecting menu items that might cause cascading object-destruction effects, caused problems with the Browser::SetBlockCommandExecution() workaround, the reasoning for which can be found in BrowserWindowGtk and is reproduced here: // This piece of code is based on the fact that calling // gtk_window_activate_key() method against |window_| may only trigger a // browser command execution, by matching either a global accelerator // defined in above |kAcceleratorMap| or the accelerator key of a menu // item defined in chrome/browser/gtk/standard_menus.cc. // // Here we need to retrieve the command id (if any) associated to the // keyboard event. Instead of looking up the command id in above // |kAcceleratorMap| table by ourselves, we block the command execution of // the |browser_| object then send the keyboard event to the |window_| by // calling gtk_window_activate_key() method, as if we are activating an // accelerator key. Then we can retrieve the command id from the // |browser_| object. // // Pros of this approach: // 1. We can handle accelerators defined not only in above // |kAcceleratorMap| table, but also those in standard_menus.cc. // 2. We don't need to care about keyboard layout problem, as // gtk_window_activate_key() method handles it for us. // // Cons: // 1. The logic is a little complicated. // 2. We should be careful not to introduce any accelerators that trigger // customized code instead of browser commands. The easiest and cleanest thing is just to remove the OwnedWidgetGtk. BUG=none TEST=interactive ui tests pass again Review URL: http://codereview.chromium.org/522028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35404 0039d316-1c4b-4281-b951-d872f2087c98
* Implement browser action context menu on linux.estade@chromium.org2009-12-311-3/+12
| | | | | | | | | BUG=30656 TEST=manual (right click on browser actions and test the actions) Review URL: http://codereview.chromium.org/521016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35400 0039d316-1c4b-4281-b951-d872f2087c98
* Make back forward menu model a MenuModel.estade@chromium.org2009-12-301-11/+13
| | | | | | | | | | | On Linux, implement just enough MenuModel support in GtkMenu. On Linux + windows, remove wrapper classes. On Mac, just change a few function calls around. BUG=none TEST=unit test + manually clicking around on it in debug mode Review URL: http://codereview.chromium.org/501168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35389 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Fix context menu positioning.estade@chromium.org2009-11-061-7/+16
| | | | | | | | | | There are still some issues with context menus. The context menu doesn't respect links, for example. That is, if you tab to a link and hit the menu button, it will act as if you right clicked on the upper left pixel of the web page (both in content and position of the menu). This seems to be a webkit bug/missing feature as safari 4 on windows does the same. However, some cases do work as expected, for example if you select text and hit the menu button. Anyway, I'll do the webkit side of this fix as some later patch. BUG=26811 Review URL: http://codereview.chromium.org/371033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31301 0039d316-1c4b-4281-b951-d872f2087c98
* More style nits.erg@google.com2009-10-141-1/+1
| | | | | | | | (Working on cleaning chrome/ so hopefully we can lint it by default.) Review URL: http://codereview.chromium.org/274040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28971 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Fix memory leak from r27666.estade@chromium.org2009-09-301-0/+4
| | | | | | | | | | | Make MenuGtk take ownership of submenus. BUG=none TEST=valgrind doesn't complain Review URL: http://codereview.chromium.org/251053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27689 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Set the back/forward and bookmark bar menus to always show their images.estade@chromium.org2009-09-111-0/+3
| | | | | | | | | | This only works for GTK 2.16+. BUG=21495 Review URL: http://codereview.chromium.org/199099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26043 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: implement bookmark manager copy/paste.estade@chromium.org2009-08-041-0/+6
| | | | | | | | | | | | - Refactor bookmark util clipboard code to be cross platform. - Add a CBF_DATA format for writing arbitrary data to the clipboard. - Change MenuGtk so that showing a menu only makes the menu items update asynchronously. This way we can show the menu immediately and we won't get in trouble if the delegate's IsCommandEnabled() runs a nested message loop. I did not do any mac-side implementation of the new clipboard stuff. The implementation should be easy when they get around to writing the bookmark manager. Review URL: http://codereview.chromium.org/159815 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22419 0039d316-1c4b-4281-b951-d872f2087c98
* linux: fix regression where opening the page menu would cause a reloadevan@chromium.org2009-08-031-0/+5
| | | | | | | | | | I tried to be clever before, but I turned out needing brute force. BUG=17647 Review URL: http://codereview.chromium.org/159822 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22336 0039d316-1c4b-4281-b951-d872f2087c98
* left a file outestade@chromium.org2009-07-281-0/+4
| | | | | | | | TBR=awong Review URL: http://codereview.chromium.org/159550 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21906 0039d316-1c4b-4281-b951-d872f2087c98
* linux: implement encodings menuevan@chromium.org2009-07-211-10/+2
| | | | | | | | BUG=11599 Review URL: http://codereview.chromium.org/155830 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21140 0039d316-1c4b-4281-b951-d872f2087c98
* Reduce header dependencies in chrome/browser/phajdan.jr@chromium.org2009-06-161-2/+3
| | | | | | | | In my scan of headers I got up to browser/gtk/ Review URL: http://codereview.chromium.org/126131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18500 0039d316-1c4b-4281-b951-d872f2087c98
* GTK bookmark manager: organize menu and aesthetic improvements.estade@chromium.org2009-06-081-0/+5
| | | | | | Review URL: http://codereview.chromium.org/118388 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17868 0039d316-1c4b-4281-b951-d872f2087c98
* Move ConvertAcceleratorsFromWindowsStyle into chrome/common/gtk_util.mattm@chromium.org2009-06-051-5/+0
| | | | | | | | | | Use it on the custom startup url buttons. BUG=11507 Review URL: http://codereview.chromium.org/118327 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17796 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Clean up the bookmark bar context menuerg@google.com2009-05-211-0/+1
| | | | | | | | | - Make items that should be checkboxes into checkboxes - Clean up accelerator spam. Review URL: http://codereview.chromium.org/113721 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16653 0039d316-1c4b-4281-b951-d872f2087c98
* Activate download shelf button while the menu is showing.estade@chromium.org2009-05-211-5/+12
| | | | | | | | TEST=download something. Press the down arrow button on the right of the item. A menu should popup and the button should appear to depress. The button should pop back when you close the menu (either by clicking away from it or by choosing an item in it). Review URL: http://codereview.chromium.org/113684 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16623 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Display context menus on right-clicking a bookmark menu item.erg@google.com2009-05-121-17/+11
| | | | | | | | | | | - Refactors events so as a side effect, shift or control clicking a bookmark menu item opens with the correct disposition. - Moves away from use of MenuGtk, as this menu does just too much weird stuff with events to use the general class. Review URL: http://codereview.chromium.org/115270 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15921 0039d316-1c4b-4281-b951-d872f2087c98
* Clicking on a folder in the bookmark bar now shows its contents as a menu.erg@google.com2009-05-061-0/+22
| | | | | | | | http://crbug.com/11250 Review URL: http://codereview.chromium.org/114005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15463 0039d316-1c4b-4281-b951-d872f2087c98
* Recommit previous change with GYP files fixed.erg@google.com2009-04-161-0/+5
| | | | | | | | | | | | | Implement BookmarkContextMenuGtk and hook it up to most bookmark bar elements. Also: - Fixes window dispositions (shift-click works on bookmark bar items). - Reorganizes gtk_utils Original Review URL: http://codereview.chromium.org/76002 Review URL: http://codereview.chromium.org/67223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13857 0039d316-1c4b-4281-b951-d872f2087c98
* Reverts the previous two commits. (r13812 and r13811).erg@google.com2009-04-151-5/+0
| | | | | | Review URL: http://codereview.chromium.org/75023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13813 0039d316-1c4b-4281-b951-d872f2087c98
* Implement BookmarkContextMenuGtk and hook it up to most bookmark bar elements.erg@google.com2009-04-151-0/+5
| | | | | | | | | | Also: - Fixes window dispositions (shift-click works on bookmark bar items). - Reorganizes gtk_utils Review URL: http://codereview.chromium.org/76002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13811 0039d316-1c4b-4281-b951-d872f2087c98
* Simplify TabGtk::ContextMenuController by adding methods to dynamically ↵jhawkins@chromium.org2009-04-141-3/+7
| | | | | | | | build a MenuGtk and use them. Review URL: http://codereview.chromium.org/68013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13722 0039d316-1c4b-4281-b951-d872f2087c98
* Implement context menu handling for the Linux tab strip.jhawkins@chromium.org2009-04-141-0/+3
| | | | | | Review URL: http://codereview.chromium.org/73053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13714 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: Ignore certain menu accelerators.estade@chromium.org2009-04-141-0/+5
| | | | | | Review URL: http://codereview.chromium.org/73003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13643 0039d316-1c4b-4281-b951-d872f2087c98
* Gtk: pass the correct event time when we show right click context menus in ↵estade@chromium.org2009-04-031-1/+4
| | | | | | | | the render view. Review URL: http://codereview.chromium.org/62024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13127 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure that MenuGtks are destroyed before their accelerator group.deanm@chromium.org2009-03-171-4/+3
| | | | | | | | | | | | | When a MenuGtk is created, it is passed a GtkAccelGroup. Previously the GtkMenu widgets were destroyed after the browser window, which was the owner of the GtkAccelGroup. Make the toolbar own a reference to the GtkAccelGroup, and teardown all GtkMenus that reference it beforehand. Some MenuGtk cleanup while debugging the problem. BUG=8866 Review URL: http://codereview.chromium.org/48065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11872 0039d316-1c4b-4281-b951-d872f2087c98
* Move a bunch of our GTK code that was previous manually handling references ↵deanm@chromium.org2009-03-161-4/+2
| | | | | | | | | (and often doing it incorrect / leaking) to use an OwnedWidgetGtk. Review URL: http://codereview.chromium.org/48007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11750 0039d316-1c4b-4281-b951-d872f2087c98
* Normalize end of file newlines in chrome/browser/gtk/.deanm@chromium.org2009-03-101-1/+0
| | | | | | | | All files should now end in only a single newline. Review URL: http://codereview.chromium.org/42010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11325 0039d316-1c4b-4281-b951-d872f2087c98
* Implement right click context menu on gtk.estade@chromium.org2009-03-091-2/+7
| | | | | | Review URL: http://codereview.chromium.org/40266 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11271 0039d316-1c4b-4281-b951-d872f2087c98
* Implement accelerators in the gtk port (try 2).erg@google.com2009-03-061-1/+8
| | | | | | | | | | | - Adds accelerators to all the menu items that had them on windows. - Adds accelerators to back (Alt+left), forward (Alt+right), reload (Ctr+R) and focus the URL box (Ctr+L). Review URL: http://codereview.chromium.org/39278 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11166 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Implement accelerators in the gtk port" at avi's request.erg@google.com2009-02-251-8/+1
| | | | | | | This reverts commit 1dbbeb791d5a9ae0740afb5d7eb57710c93b7f38. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10403 0039d316-1c4b-4281-b951-d872f2087c98
* Implement accelerators in the gtk port.erg@google.com2009-02-251-1/+8
| | | | | | | | | | | - Adds accelerators to all the menu items that had them on windows. - Adds accelerators to back (Alt+left), forward (Alt+right), reload (Ctr+R) and focus the URL box (Ctr+L). Review URL: http://codereview.chromium.org/28105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10387 0039d316-1c4b-4281-b951-d872f2087c98
* Port back_forward_menu_model to linux.estade@chromium.org2009-02-181-4/+36
| | | | | | | | | | | * Refactor BackForwardMenuModel. - Create platform-specific subclasses that implement menu delegate interfaces - Push almost all functionality into BackForwardMenuModel * Implement GTK back/forward dropdowns (in MenuGtk and BrowserToolbarViewGtk) Review URL: http://codereview.chromium.org/21440 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9983 0039d316-1c4b-4281-b951-d872f2087c98
* Create a menu wrapper class for GTK menus, and use it for the page and app ↵erg@google.com2009-02-171-0/+61
menus. Review URL: http://codereview.chromium.org/20245 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9893 0039d316-1c4b-4281-b951-d872f2087c98