summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 05:21:35 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 05:21:35 +0000
commit4e187ef6569e197a6fd446fa5c2733ae7f0138b4 (patch)
tree2e0dff2c70620acb5ee575af258c5d7d957dac3e /chrome/browser/cocoa/bookmark_bar_folder_controller.mm
parentfd8035dceb5e77948e10f4fd2d954916fc7800cc (diff)
downloadchromium_src-4e187ef6569e197a6fd446fa5c2733ae7f0138b4.zip
chromium_src-4e187ef6569e197a6fd446fa5c2733ae7f0138b4.tar.gz
chromium_src-4e187ef6569e197a6fd446fa5c2733ae7f0138b4.tar.bz2
Add bookmark copying while dragging by holding down the <option> key.
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
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_folder_controller.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_folder_controller.mm16
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
index f000750c..2dca753 100644
--- a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
@@ -458,7 +458,9 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// TODO(jrg): ARGH more code dup.
// http://crbug.com/35966
-- (BOOL)dragButton:(BookmarkButton*)sourceButton to:(NSPoint)point {
+- (BOOL)dragButton:(BookmarkButton*)sourceButton
+ to:(NSPoint)point
+ copy:(BOOL)copy {
DCHECK([sourceButton isKindOfClass:[BookmarkButton class]]);
const BookmarkNode* sourceNode = [sourceButton bookmarkNode];
@@ -466,9 +468,15 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
int destIndex = [self indexForDragOfButton:sourceButton toPoint:point];
if (destIndex >= 0 && sourceNode) {
- [parentController_ bookmarkModel]->Move(sourceNode,
- [parentButton_ bookmarkNode],
- destIndex);
+ if (copy) {
+ [parentController_ bookmarkModel]->Copy(sourceNode,
+ [parentButton_ bookmarkNode],
+ destIndex);
+ } else {
+ [parentController_ bookmarkModel]->Move(sourceNode,
+ [parentButton_ bookmarkNode],
+ destIndex);
+ }
} else {
NOTREACHED();
}