summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_button.h
Commit message (Collapse)AuthorAgeFilesLines
* Mac/clang: Uncontentious fixes.thakis@chromium.org2010-06-111-1/+1
| | | | | | | | | | | | | * Remove unused variables * Make types in h and cc files agree * Use subclasses if we call subclass methods * Fix one real bug (`if (a); a->foo()`) * Fix forward declarations to be correct * Don't mark some definitions with "extern" Review URL: http://codereview.chromium.org/2730015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49570 0039d316-1c4b-4281-b951-d872f2087c98
* Implement drag from bookmark manager to bookmark bar or a folder thereof. ↵mrossetti@chromium.org2010-05-181-3/+22
| | | | | | | | | | | | | | | | | | | Implement drag of other bookmark and URL sources such as from the Desktop or a text selection. BUG=39884,44228 TEST=Note: For all drag operations verify that the appropriate drop indicator is presented while dragging. When dragging onto a bookmark bar folder the folder button should be highlighted and, after a short delay, open into a menu. When dragging between folders or on top of a non-folder bookmark an insertion bar (vertical when in the bookmark bar, horizontal when in a folder menu) should be presented. For 'copy' moves the drag image should be adorned with a plus sign in a green circle. A non-copy move should show no such tag. 1) Drag a non-folder bookmark from the bookmark manager to the bookmark bar such that it falls on a non-folder bookmark. Verify that the bookmark is moved to be on the bar just before the bookmark upon which is was dropped. 2) Drag a folder bookmark from the manager to the bookmark bar such that it falls on a non-folder bookmark. Verify that the folder (as a folder) is moved to be on the bar just before the bookmark upon which is was dropped. 3) Drag a bookmark from the manager to a folder on the bookmark bar. Verify that the bookmark is added to the folder at the end and removed from the old location in the manager. 4) Drag a bookmark from the manager to a folder on the bookmark bar and wait for the folder to open and then drag to within the folder. Verify that dropping places the bookmark and removes it from the old location in the manager. 5) Drag a bookmark from the bar to the manager and verify that the manager now shows the dragged bookmark. (Note that this should be a 'move' but is currently a 'copy'. See http://crbug.com/44039.) 6) Drag a bookmark clipping from the Finder Desktop to the bookmark bar. Verify that it is added to the bar as a new bookmark. 7) Drag a bookmark clipping from the Finder Desktop to a folder on the bookmark bar and drop it within the folder menu. Verify that it is added to the folder as a new bookmark. 8) Create a URL in TextEdit or Stickies, select it and drag to the bookmark bar. Verify that it is added to the bar. 9) Create a URL in TextEdit or Stickies, select it and drag to a folder on the bookmark bar and drop it within the folder menu. Verify that it is added to the folder. Review URL: http://codereview.chromium.org/2066001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47523 0039d316-1c4b-4281-b951-d872f2087c98
* Add and implement cut/copy/paste to the bookmark bar and folder context ↵mrossetti@chromium.org2010-04-291-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | menus.Prevent dropping bookmark folders onto their children to avoid creating cycles and crashing. Keep folder menu windows open after a cut/copy/paste/delete and drop operation. Add test helpers for easing comparison of bookmark model changes. BUG=41217,36614,32064, 41404 Add and implement cut/copy/paste to the bookmark bar and folder context menus.Prevent dropping bookmark folders onto their children to avoid creating cycles and crashing. Keep folder menu windows open after a cut/copy/paste/delete and drop operation. TEST=1) Present the context menu for the bookmark bar in various places and insure that the cut/copy/paste menu items are shown and properly enabled or disabled. 2) Present the context menu for a folder menu in various places and insure that the cut/copy/paste menu items are shown and properly enabled or disabled. 3) Perform cut/copy/paste/delete operations in a folder menu and subfolder menu and verify that the menu remains presented after the operation completes. 4) Drag a bookmark item from the bar to another location on the bar and verify that the button no longer shows up in the old location but does show up in the new location. 5) Drag a bookmark item from the bar to be within a folder located _after_ the item being dragged. Verify the bar no longer shows the bookmark item. Verify the folder does show the bookmark item. Verify that the folder window has shifted to the left so that it remains aligned with it corresponding bar folder indicator. 6) Drag a bookmark item from the bar to be within a folder located _before_ the item being dragged. Verify the bar no longer shows the bookmark item. Verify the folder does show the bookmark item. Verify that the folder window has _not_ shifted to the left and that it remains aligned with it corresponding bar folder indicator. 7) Drag a bookmark around within the same folder and verify that the folder window does not move. 8) Drag a bookmark item from a folder to the bar in a position _after_ the folder form which the item comes. The folder menu window should close. 9) Drag a bookmark item from a folder to a different folder and verify that the original folder closes and the new folder remains open. 10) Drag an item from a parent folder to a child folder and verify that both folders remain open. Verify that the subfolder remains aligned to its associated folder icon in the parent folder. 11) Drag an item from a child folder to a parent folder. Verify that the child folder closes and the parent folder remains open. 12) Try dragging a parent folder onto a child folder and verify that the drag is not allowed to complete. 13) Hover over a folder item in a folder menu window. Verify that the folder opens up a subview menu window. Now drag the original folder (the one being hovered over) and verify that its subfolder menu automatically closes. 14) Slowly shrink window width until "off the side" menu appears; make sure it appears as soon as the last button gets removed. Now slowly grow window and make sure it goes away at the right time. 15) Add enough bookmarks to the bookmark bar to nearly fill the width of the window. Verify that the off-the-side chevron is not showing. Slowly shrink the width of the window until the off-the-side-chevron appears. Verify that the right-most bookmark button has disappeared and does not draw over the top of the chevron. Continue to shrink the window and verify that bookmark buttons disappear. View the contents of the chevron and verify that the bookmark buttons which previously appeared on the bar now appear in the chevron. Slowly grow the window and verify that bookmark buttons reappear without drawing over the top of the chevron. Verify that those bookmark buttons no longer appear in the chevron when it is popped up. Continue growing the window until all bookmark buttons appear in the bar and the chevron disappears. 16) Shrink the window so that the off-the-side chevron appears and contains three or more bookmarks. Pop open the chevron. Drag bookmarks up and down in the chevron menu and verify that moves and copies are performed. Drag a bar bookmark into the chevron and verify that the chevron pops up and allows the drag. Verify that the bar and chevron contents rearrange such that buttons on the bar fill but do not overflow the bar. Drag a chevron bookmark out onto the bar. Once again verify that the bar and chevron buttons rearrange such that the bar is full but not overflowing. Review URL: http://codereview.chromium.org/1742003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45965 0039d316-1c4b-4281-b951-d872f2087c98
* Improve bookmark bar folder scroll.jrg@chromium.org2010-04-161-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | BUG=39791 TEST=\ Create bookmark folders with various quantites of bookmarks. Make sure normal folders work. Open some that don't fit on the screen. See rounded corners on bottom. Try and move mouse to bottom of screen --> window grows and scrolls. Move mouse to top of screen --> window does NOT change size but does scroll. Move mouse off folder while scrolling --> scrolling stops. Make sure no buttons get "stuck" with a mouse-enter (highlit). Make sure no "getting stuck" or "window scrolls off the screen". Briefly test subfolders. xib changes: - Window content view is now BookmarkBarFolderWindowContentView - BookmaerkBarFolderView now wrapped in an NSScrollView - Some view autosizing changed Review URL: http://codereview.chromium.org/1593025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44755 0039d316-1c4b-4281-b951-d872f2087c98
* Implement cut and paste and rework copy and delete bookmark actions from ↵mrossetti@chromium.org2010-04-141-6/+0
| | | | | | | | | | | | | | | context menus. Eliminate bifurcated 'parentController_' data member (leaving this common behavior to the BookmarkFolderTarget class). Provide context menus (one for button and another for folder) for the folder controller thus allowing far easier identification of the target of the action. BookmarkBar.xib changes: Added Cut and Paste menu items to the button and folder contextual menus. Reconfigured the menus with separators and some rearranging to match Windows. BookmarkBarFolderWindow.xib changes: Copied the button and folder contextual menus from the BookmarkBar.xib and wired them up to the folder controller instead. BUG=23541 TEST=Present context menu for bookmark bar and verify the presence of Cut/Copy/Paste/Delete. Verify proper enabling (i.e. Paste should not be enabled until a bookmark or folder has been Cut or Copied). Perform each action Cut, Copy, Delete and Paste. Perform these tests for the contents of a folder coming off of the bookmark bar and for subfolders, too. Insure that pasting can be performed from the bar to a folder, a folder to the bar, bar to bar, folder to folder, at the beginning and at the end of each. Review URL: http://codereview.chromium.org/1611027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44505 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Adds a BookmarkButtonDelegate method to retrieve the top-level browser ↵rohitrao@chromium.org2010-04-141-0/+3
| | | | | | | | | | window. Used to lock bar visibility when dragging. BUG=40740 TEST=Go Fullscreen. Drag a bookmark button that is inside a folder. When the folder disappears, the overlay bar should stay visible. Review URL: http://codereview.chromium.org/1610023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44497 0039d316-1c4b-4281-b951-d872f2087c98
* Once the initial URL is opened in a new window, insure that subsequent URLs ↵mrossetti@chromium.org2010-04-131-4/+4
| | | | | | | | | | | are opened in the new window instead of the original window. This change hinges on having URL opening code return the browser into which the URL was opened so that subsequent openings may now into which browser to do so. BUG=39901,41104 TEST=Bring up context menu on a folder with two or more bookmarks and select "Open All in Incognito Window". Insure that all of the URLs are opened in the newly created, top-most window. Verify that no new tabs were created in the original window. Perform this same test using "Open All in New Window". Review URL: http://codereview.chromium.org/1633009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44302 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 44201 - Once the initial URL is opened in a new window, insure that ↵mrossetti@chromium.org2010-04-111-4/+4
| | | | | | | | | | | | | | subsequent URLs are opened in the new window instead of the original window. This change hinges on having URL opening code return the browser into which the URL was opened so that subsequent openings may now into which browser to do so. BUG=39901 TEST=Bring up context menu on a folder with two or more bookmarks and select "Open All in Incognito Window". Insure that all of the URLs are opened in the newly created, topmost window. Verify that no new tabs were created in the original window. Perform this same test using "Open All in New Window". Review URL: http://codereview.chromium.org/1634004 TBR=mrossetti@chromium.org Review URL: http://codereview.chromium.org/1520032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44202 0039d316-1c4b-4281-b951-d872f2087c98
* Once the initial URL is opened in a new window, insure that subsequent URLs ↵mrossetti@chromium.org2010-04-111-4/+4
| | | | | | | | | | | are opened in the new window instead of the original window. This change hinges on having URL opening code return the browser into which the URL was opened so that subsequent openings may now into which browser to do so. BUG=39901 TEST=Bring up context menu on a folder with two or more bookmarks and select "Open All in Incognito Window". Insure that all of the URLs are opened in the newly created, top-most window. Verify that no new tabs were created in the original window. Perform this same test using "Open All in New Window". Review URL: http://codereview.chromium.org/1634004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44201 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the themeing from the folder menu background, text in the folder menu ↵mrossetti@chromium.org2010-04-021-0/+6
| | | | | | | | | | | items, and no longer needed calls. Changed the menu button stroke color to a lighter shade of black. Did a bit of refactoring of how bookmark buttons are created. BUG=39428 TEST=Pop up a folder menu and insure that the background does not adopt any theme settings. Review URL: http://codereview.chromium.org/1589005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43511 0039d316-1c4b-4281-b951-d872f2087c98
* Make the "off the side" menu (chevron) behave like the other bookmarkjrg@chromium.org2010-03-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | bar folders. E.g. supports DragAndDrop. BUG=34910 TEST=Make sure you can DnD items to/from the "off the side" chevron. Make sure context menus on those buttons work as well (e.g. delete). Make sure the chevron is NOT draggable. Make sure the chevron works properly as a "hover open" button when dragging something else around; e.g. it pops open if you hover over it. (It's small so this may take patience). Drop a folder from the bar into itself. Make sure we don't crash. xib change: - chevron button is now BookmarkButton, not MenuButton. Also has BookmarkButtonCell in it. - "off the side" menu removed. Review URL: http://codereview.chromium.org/1520003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43263 0039d316-1c4b-4281-b951-d872f2087c98
* Cmd-click in bookmark subfolders will open all.jrg@chromium.org2010-03-241-0/+13
| | | | | | | | | | | | | | | Refactor code for better sharing. BUG=http://crbug.com/26380 (cmd-click in subfolders now opens all) BUG=http://crbug.com/35966 (code dup reduced) TEST=\ Cmd-click a folder in the bar --> open all Cmd-click a folder in a SUBfolder of the bar --> open all Review URL: http://codereview.chromium.org/1134008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42546 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Do not lock bar visibility when the bookmark bar is detached.rohitrao@chromium.org2010-03-151-0/+12
| | | | | | | | | BUG=37271,37433,37937 TEST=Go fullscreen on the NTP with the bookmark bar detached. Drag a bookmark around. Overlay should not open. TEST=Go fullscreen on the NTP with the bookmark bar detached. Open a bookmark folder. Overlay should not open. Review URL: http://codereview.chromium.org/881003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41589 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup.mrossetti@chromium.org2010-03-121-1/+1
| | | | | | | | | BUG=None TEST=None Review URL: http://codereview.chromium.org/905001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41384 0039d316-1c4b-4281-b951-d872f2087c98
* Add bookmark copying while dragging by holding down the <option> key.mrossetti@chromium.org2010-03-111-2/+7
| | | | | | | | | BUG=35969 TEST=Hold down the <option> key while dragging a bookmark to a new location. Repeat with the following: 1) From bookmark bar to bookmark bar, 2) from bookmark bar into a folder, 3) from within a folder to a different place within the same folder, 4) from within a folder to the bookmark bar, 5) from within a folder to a different folder. Check to insure that the original bookmark (and its contents if it was a folder) are in both the original location and the new location. Review URL: http://codereview.chromium.org/790001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41252 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Lock bar visibility during a bookmark button drag, forcing the ↵rohitrao@chromium.org2010-03-081-0/+8
| | | | | | | | | | fullscreen overlay to stay shown. BUG=37433 TEST=Go fullscreen. Open a folder on the bookmark bar and drag a button around such that the folder closes. The overlay should not disappear. Review URL: http://codereview.chromium.org/669166 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40944 0039d316-1c4b-4281-b951-d872f2087c98
* [Mac] Lock open the fullscreen overlay when browsing bookmark folders.rohitrao@chromium.org2010-03-051-0/+7
| | | | | | | | BUG=37271 TEST=Go fullscreen. Open a folder on the bookmarkbar and hover over one of its subentries. Overlay should not scroll back up. Review URL: http://codereview.chromium.org/669086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40740 0039d316-1c4b-4281-b951-d872f2087c98
* Custom "menus" for the bookmark bar folders. jrg@chromium.org2010-02-241-14/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Full behavior: http://JRG_WRITE_FULL_DOC_AND_TEST_PLAN_TOMORROW BUG=17608 (and a slew of others) Brief details on how to test: - add some bookmarks and bookmark folders. - at a basic level, make sure bookmark folders feel like menus e.g. -- click to open -- can open "submenus" and sub-sub-menus -- can open (click on) bookmarks in any of these submenus - click-drag does NOT open a menu (different than Mac menus); it initiates a Drag - click on folder in bookmark bar initiates "hover open"; moving mouse over other folders will pop them open immediately (much like Mac menus) - Bookmark bar non-drag hover-open is immediate, but bookmark folder hover-open has a brief delay so quick "move down" a folder does not trigger them all to open while you travel (much like Mac menus). - DnD of bookmarks and folders on bookmark bar. - While doing DnD of bookmark, "hover" over a folder and see it open. - Bookmark folder menus have normal DnD "drop indicators" like the bookmark bar. - Can "hover open" a nested subfolder. - Can drag a bookmark from one deep sub-sub-folder to a different deep one. - Confirm buttons and folders in submenus are themed, both with the theme set at launch time and the theme we change to after launch. - Empty folders have an "(empty)" item which is not selectable. - Intentional delay in closing a sub-sub-folder when hovering over another one. E.g. When moving to a sub-sub-menu, 'brief' travel over a different submenu does not close the destination sub-menu. - can use bookmark context menus in folder "menus". - confirm DnD from "Other bookmarks" to any other random folder and vice versa. - While non-drag hover open is active, clicking anywhere other than the bookmark bar or folder (e.g. the main web view) turns it off. TODO: - random bugs (e.g. "add folder" over a folder doesn't put it in there) - (empty) needs to be revisited, both visually and for a drop indication - core animations instead of drop indicators - ... Review URL: http://codereview.chromium.org/551226 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39947 0039d316-1c4b-4281-b951-d872f2087c98
* Make download items drag sources on OS X.thakis@chromium.org2010-01-301-11/+4
| | | | | | | | | | | | | Extract button dragging out of BookmarkButton into DraggableButton. Make BookmarkButton a subclass of DraggableButton. Create new class DownloadItemButton and make it a subclass of DraggableButton. xib change: Make download item a DownloadItemButton instead of an NSButton. BUG=15776 TEST=Download something, wait for it to complete, then drag it from the download shelf to somewhere. It should now work. Bookmarks should still be draggable in the bookmarks bar. Review URL: http://codereview.chromium.org/180036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37621 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: allow bookmark bar buttons to be dragged as URLs.viettrungluu@chromium.org2009-12-011-2/+17
| | | | | | | | | | | | | TODO #1: dragging of folder buttons. TODO #2: perhaps holding Option while dragging on the bookmark bar should force the bookmark to be copied instead of moved. BUG=17608, 28842 TEST=Make a bunch of (non-folder) bookmarks on the bookmark bar; try dragging these bookmark bar buttons to the desktop, to the web content area, to text boxes, to other browsers -- these should all do sensible things; make sure that dragging them around on the bookmark bar still rearranges them. Review URL: http://codereview.chromium.org/434095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33478 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: fix Esc-key cancellation of bookmark bar button drags.viettrungluu@chromium.org2009-11-251-2/+3
| | | | | | | | | | | | | The drag would be cancelled after pressing Esc, but moving the mouse again would cause the bookmark bar button to see a drag again and start a new drag. This patch makes the button wait for the next mouse down. BUG=28502 TEST=Drag bookmark bar button and keep mouse button; press Esc (and see cancellation animation); move mouse again and make sure a new drag doesn't start. Review URL: http://codereview.chromium.org/437055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33067 0039d316-1c4b-4281-b951-d872f2087c98
* Drag and drop of buttons/folders from bar to bar.jrg@chromium.org2009-11-181-0/+23
Does not include DnD to/from menus. No animations of drop destination yet. BUG=http://crbug.com/17608 TEST=Do some draggin and droppin. Confirm click still works on the marks and folders. Confirm "other bookmarks" canNOT be moved. Confirm NTP / detached bar also works for DnD. Review URL: http://codereview.chromium.org/395031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32341 0039d316-1c4b-4281-b951-d872f2087c98