OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/chrome/browser/ui/bookmarks/bookmark_menu_view.h" | 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_menu_view.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/mac/objc_property_releaser.h" | 10 #include "base/mac/objc_property_releaser.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 rootAncestor:otherBookmarks]]; | 153 rootAncestor:otherBookmarks]]; |
154 } | 154 } |
155 | 155 |
156 // The second section contains all the top level folders (except for the | 156 // The second section contains all the top level folders (except for the |
157 // permanent nodes). | 157 // permanent nodes). |
158 base::scoped_nsobject<NSMutableArray> folderSection( | 158 base::scoped_nsobject<NSMutableArray> folderSection( |
159 [[NSMutableArray alloc] init]); | 159 [[NSMutableArray alloc] init]); |
160 std::vector<const BookmarkNode*> rootLevelFolders = | 160 std::vector<const BookmarkNode*> rootLevelFolders = |
161 RootLevelFolders(self.bookmarkModel); | 161 RootLevelFolders(self.bookmarkModel); |
162 bookmark_utils_ios::SortFolders(&rootLevelFolders); | 162 bookmark_utils_ios::SortFolders(&rootLevelFolders); |
163 for (auto node : rootLevelFolders) { | 163 for (auto* node : rootLevelFolders) { |
164 [folderSection addObject:[BookmarkMenuItem folderMenuItemForNode:node | 164 [folderSection addObject:[BookmarkMenuItem folderMenuItemForNode:node |
165 rootAncestor:node]]; | 165 rootAncestor:node]]; |
166 } | 166 } |
167 if ([folderSection count]) { | 167 if ([folderSection count]) { |
168 // Add the title and the divider at the top of the section. | 168 // Add the title and the divider at the top of the section. |
169 [folderSection | 169 [folderSection |
170 insertObject:[BookmarkMenuItem sectionMenuItemWithTitle: | 170 insertObject:[BookmarkMenuItem sectionMenuItemWithTitle: |
171 l10n_util::GetNSString( | 171 l10n_util::GetNSString( |
172 IDS_IOS_BOOKMARK_FOLDERS_LABEL)] | 172 IDS_IOS_BOOKMARK_FOLDERS_LABEL)] |
173 atIndex:0]; | 173 atIndex:0]; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 404 |
405 self.primaryMenuItem = menuItem; | 405 self.primaryMenuItem = menuItem; |
406 [self.tableView reloadData]; | 406 [self.tableView reloadData]; |
407 } | 407 } |
408 | 408 |
409 - (void)setScrollsToTop:(BOOL)scrollsToTop { | 409 - (void)setScrollsToTop:(BOOL)scrollsToTop { |
410 self.tableView.scrollsToTop = scrollsToTop; | 410 self.tableView.scrollsToTop = scrollsToTop; |
411 } | 411 } |
412 | 412 |
413 @end | 413 @end |
OLD | NEW |