| 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 #import "chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.h" | 5 #import "chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.h" |
| 6 | 6 |
| 7 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
| 8 #import "base/strings/string16.h" | 8 #import "base/strings/string16.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #import "chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.h" | 10 #import "chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.h" |
| 11 #import "chrome/browser/ui/cocoa/applescript/constants_applescript.h" | 11 #import "chrome/browser/ui/cocoa/applescript/constants_applescript.h" |
| 12 #include "chrome/browser/ui/cocoa/applescript/error_applescript.h" | 12 #include "chrome/browser/ui/cocoa/applescript/error_applescript.h" |
| 13 #include "components/bookmarks/browser/bookmark_model.h" | 13 #include "components/bookmarks/browser/bookmark_model.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 using bookmarks::BookmarkModel; | 16 using bookmarks::BookmarkModel; |
| 17 using bookmarks::BookmarkNode; |
| 17 | 18 |
| 18 @implementation BookmarkFolderAppleScript | 19 @implementation BookmarkFolderAppleScript |
| 19 | 20 |
| 20 - (NSArray*)bookmarkFolders { | 21 - (NSArray*)bookmarkFolders { |
| 21 NSMutableArray* bookmarkFolders = [NSMutableArray | 22 NSMutableArray* bookmarkFolders = [NSMutableArray |
| 22 arrayWithCapacity:bookmarkNode_->child_count()]; | 23 arrayWithCapacity:bookmarkNode_->child_count()]; |
| 23 | 24 |
| 24 for (int i = 0; i < bookmarkNode_->child_count(); ++i) { | 25 for (int i = 0; i < bookmarkNode_->child_count(); ++i) { |
| 25 const BookmarkNode* node = bookmarkNode_->GetChild(i); | 26 const BookmarkNode* node = bookmarkNode_->GetChild(i); |
| 26 | 27 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 ++index; | 196 ++index; |
| 196 int count = -1; | 197 int count = -1; |
| 197 while (index) { | 198 while (index) { |
| 198 if (bookmarkNode_->GetChild(++count)->is_url()) | 199 if (bookmarkNode_->GetChild(++count)->is_url()) |
| 199 --index; | 200 --index; |
| 200 } | 201 } |
| 201 return count; | 202 return count; |
| 202 } | 203 } |
| 203 | 204 |
| 204 @end | 205 @end |
| OLD | NEW |