summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_tree_controller.mm
diff options
context:
space:
mode:
authorsnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 22:44:34 +0000
committersnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 22:44:34 +0000
commit8dcc7da747562e0293a3cb1ab19fadc4e9260f56 (patch)
treedb1a5c62258f5808edb89af8236fcd64a66335a9 /chrome/browser/cocoa/bookmark_tree_controller.mm
parent6aaa9cc7a860bf5a12aed5d394333bcc7884e5e1 (diff)
downloadchromium_src-8dcc7da747562e0293a3cb1ab19fadc4e9260f56.zip
chromium_src-8dcc7da747562e0293a3cb1ab19fadc4e9260f56.tar.gz
chromium_src-8dcc7da747562e0293a3cb1ab19fadc4e9260f56.tar.bz2
Mac bookmark manager: Make URLs editable.
BUG=32028 TEST=BookmarkItemTest.URL*. Manually: click the URL of a selected item and it will become editable. Type new value and hit Return/Enter. Review URL: http://codereview.chromium.org/551055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_tree_controller.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_tree_controller.mm10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/bookmark_tree_controller.mm b/chrome/browser/cocoa/bookmark_tree_controller.mm
index 60d4ad7..704f8ac 100644
--- a/chrome/browser/cocoa/bookmark_tree_controller.mm
+++ b/chrome/browser/cocoa/bookmark_tree_controller.mm
@@ -400,7 +400,8 @@ static void addItem(NSMenu* menu, int command, SEL action) {
if ([ident isEqualToString:kTitleColIdent]) {
[item setTitle:value];
} else if ([ident isEqualToString:kURLColIdent]) {
- [item setURLString:value];
+ if ([value length])
+ [item setURLString:value];
}
}
@@ -408,9 +409,12 @@ static void addItem(NSMenu* menu, int command, SEL action) {
- (BOOL) outlineView:(NSOutlineView*)outlineView
shouldEditTableColumn:(NSTableColumn*)tableColumn
item:(id)item {
- //TODO(snej): Make URL column editable once setter method exists (bug 10603).
NSString* ident = [tableColumn identifier];
- return [ident isEqualToString:kTitleColIdent] && ![item isFixed];
+ if ([item isFixed])
+ return NO;
+ if ([ident isEqualToString:kURLColIdent] && [item isFolder])
+ return NO;
+ return YES;
}
// Sets a cell's icon before it's drawn (NSOutlineView data source)