OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stack> | 5 #include <stack> |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" | 7 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 // Expose the parent folder children. | 560 // Expose the parent folder children. |
561 [folderTreeView_ expandItem:parentInfo]; | 561 [folderTreeView_ expandItem:parentInfo]; |
562 | 562 |
563 // Select the new folder node and put the folder name into edit mode. | 563 // Select the new folder node and put the folder name into edit mode. |
564 selection = [selection indexPathByAddingIndex:[children count] - 1]; | 564 selection = [selection indexPathByAddingIndex:[children count] - 1]; |
565 [self setTableSelectionPath:selection]; | 565 [self setTableSelectionPath:selection]; |
566 NSInteger row = [folderTreeView_ selectedRow]; | 566 NSInteger row = [folderTreeView_ selectedRow]; |
567 DCHECK(row >= 0); | 567 DCHECK(row >= 0); |
568 | 568 |
569 // Put the cell into single-line mode before putting it into edit mode. | 569 // Put the cell into single-line mode before putting it into edit mode. |
| 570 // TODO(kushi.p): Remove this when the project hits a 10.6+ only state. |
570 NSCell* folderCell = [folderTreeView_ preparedCellAtColumn:0 row:row]; | 571 NSCell* folderCell = [folderTreeView_ preparedCellAtColumn:0 row:row]; |
571 if ([folderCell | 572 if ([folderCell |
572 respondsToSelector:@selector(setUsesSingleLineMode:)]) { | 573 respondsToSelector:@selector(setUsesSingleLineMode:)]) { |
573 [folderCell setUsesSingleLineMode:YES]; | 574 [folderCell setUsesSingleLineMode:YES]; |
574 } | 575 } |
575 | 576 |
576 [folderTreeView_ editColumn:0 row:row withEvent:nil select:YES]; | 577 [folderTreeView_ editColumn:0 row:row withEvent:nil select:YES]; |
577 } | 578 } |
578 } | 579 } |
579 | 580 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 } | 659 } |
659 | 660 |
660 // Implementing isEqual: allows the NSTreeController to preserve the selection | 661 // Implementing isEqual: allows the NSTreeController to preserve the selection |
661 // and open/shut state of outline items when the data changes. | 662 // and open/shut state of outline items when the data changes. |
662 - (BOOL)isEqual:(id)other { | 663 - (BOOL)isEqual:(id)other { |
663 return [other isKindOfClass:[BookmarkFolderInfo class]] && | 664 return [other isKindOfClass:[BookmarkFolderInfo class]] && |
664 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; | 665 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; |
665 } | 666 } |
666 | 667 |
667 @end | 668 @end |
OLD | NEW |