| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #import "chrome/browser/cocoa/bookmark_tree_controller.h" | 5 #import "chrome/browser/cocoa/bookmark_tree_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #import "chrome/browser/cocoa/bookmark_item.h" | 9 #import "chrome/browser/cocoa/bookmark_item.h" |
| 10 #import "chrome/browser/cocoa/bookmark_manager_controller.h" | 10 #import "chrome/browser/cocoa/bookmark_manager_controller.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 - (void)outlineView:(NSOutlineView*)outlineView | 441 - (void)outlineView:(NSOutlineView*)outlineView |
| 442 willDisplayCell:(id)cell | 442 willDisplayCell:(id)cell |
| 443 forTableColumn:(NSTableColumn*)tableColumn | 443 forTableColumn:(NSTableColumn*)tableColumn |
| 444 item:(id)item | 444 item:(id)item |
| 445 { | 445 { |
| 446 // Use the bookmark/folder's icon. | 446 // Use the bookmark/folder's icon. |
| 447 if ([[tableColumn identifier] isEqualToString:kTitleColIdent]) { | 447 if ([[tableColumn identifier] isEqualToString:kTitleColIdent]) { |
| 448 item = (item ? item : group_); | 448 item = (item ? item : group_); |
| 449 [cell setImage:[item icon]]; | 449 [cell setImage:[item icon]]; |
| 450 } | 450 } |
| 451 | |
| 452 // Show special folders (Bookmarks Bar, Others, Recents, Search) in bold. | |
| 453 static NSFont* sBoldFont = [[NSFont boldSystemFontOfSize: | |
| 454 [NSFont smallSystemFontSize]] retain]; | |
| 455 static NSFont* sPlainFont = [[NSFont systemFontOfSize: | |
| 456 [NSFont smallSystemFontSize]] retain]; | |
| 457 [cell setFont:[item isFixed] ? sBoldFont : sPlainFont]; | |
| 458 } | 451 } |
| 459 | 452 |
| 460 // Updates the tree after the data model has changed. | 453 // Updates the tree after the data model has changed. |
| 461 - (void)itemChanged:(id)nodeItem childrenChanged:(BOOL)childrenChanged { | 454 - (void)itemChanged:(id)nodeItem childrenChanged:(BOOL)childrenChanged { |
| 462 if (nodeItem == group_) | 455 if (nodeItem == group_) |
| 463 nodeItem = nil; | 456 nodeItem = nil; |
| 464 [outline_ reloadItem:nodeItem reloadChildren:childrenChanged]; | 457 [outline_ reloadItem:nodeItem reloadChildren:childrenChanged]; |
| 465 } | 458 } |
| 466 | 459 |
| 467 @end | 460 @end |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 } | 514 } |
| 522 } | 515 } |
| 523 [super keyDown:event]; | 516 [super keyDown:event]; |
| 524 } | 517 } |
| 525 | 518 |
| 526 - (NSMenu*)menu { | 519 - (NSMenu*)menu { |
| 527 return [[self bookmarkController] menu]; | 520 return [[self bookmarkController] menu]; |
| 528 } | 521 } |
| 529 | 522 |
| 530 @end | 523 @end |
| OLD | NEW |