summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/bookmark_manager_controller.h1
-rw-r--r--chrome/browser/cocoa/bookmark_manager_controller.mm21
2 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/cocoa/bookmark_manager_controller.h b/chrome/browser/cocoa/bookmark_manager_controller.h
index 92eb2fa..6101419 100644
--- a/chrome/browser/cocoa/bookmark_manager_controller.h
+++ b/chrome/browser/cocoa/bookmark_manager_controller.h
@@ -24,6 +24,7 @@ class Profile;
Profile* profile_; // weak
scoped_ptr<BookmarkManagerBridge> bridge_;
scoped_nsobject<NSMapTable> nodeMap_;
+ scoped_nsobject<FakeBookmarkItem> root_; // Root of tree
scoped_nsobject<FakeBookmarkItem> searchGroup_; // Search Results group item
scoped_nsobject<FakeBookmarkItem> recentGroup_; // Recently-Added group item
}
diff --git a/chrome/browser/cocoa/bookmark_manager_controller.mm b/chrome/browser/cocoa/bookmark_manager_controller.mm
index f47f0c1..b5f6063 100644
--- a/chrome/browser/cocoa/bookmark_manager_controller.mm
+++ b/chrome/browser/cocoa/bookmark_manager_controller.mm
@@ -140,13 +140,13 @@ class BookmarkManagerBridge : public BookmarkModelObserver {
other,
recentGroup_.get(),
nil];
- FakeBookmarkItem* root = [[FakeBookmarkItem alloc] initWithTitle:@""
- icon:nil
- manager:self];
- [root setChildren:rootItems];
- [recentGroup_ setParent:root];
- [searchGroup_ setParent:root];
- [groupsController_ setGroup:root];
+ root_.reset([[FakeBookmarkItem alloc] initWithTitle:@""
+ icon:nil
+ manager:self]);
+ [root_ setChildren:rootItems];
+ [recentGroup_ setParent:root_];
+ [searchGroup_ setParent:root_];
+ [groupsController_ setGroup:root_];
// Turning on autosave also loads and applies the settings, which we couldn't
// do until setting up the data model, above.
@@ -335,11 +335,10 @@ class BookmarkManagerBridge : public BookmarkModelObserver {
}
// Show searchGroup_ if it's not visible yet:
- FakeBookmarkItem* root = (FakeBookmarkItem*)[groupsController_ group];
- NSArray* rootItems = [root children];
+ NSArray* rootItems = [root_ children];
if (![rootItems containsObject:searchGroup_]) {
- [root setChildren:[rootItems arrayByAddingObject:searchGroup_]];
- [self itemChanged:root childrenChanged:YES];
+ [root_ setChildren:[rootItems arrayByAddingObject:searchGroup_]];
+ [self itemChanged:root_ childrenChanged:YES];
}
}