| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/bookmark_editor_base_controller.h" | 7 #import "chrome/browser/cocoa/bookmark_editor_base_controller.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/l10n_util_mac.h" | 9 #include "app/l10n_util_mac.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/mac_util.h" | 11 #include "base/mac_util.h" |
| 12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
| 13 #include "chrome/browser/bookmarks/bookmark_model.h" | 13 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 14 #import "chrome/browser/cocoa/bookmark_all_tabs_controller.h" | 14 #import "chrome/browser/cocoa/bookmark_all_tabs_controller.h" |
| 15 #import "chrome/browser/cocoa/bookmark_editor_controller.h" | 15 #import "chrome/browser/cocoa/bookmark_editor_controller.h" |
| 16 #import "chrome/browser/cocoa/bookmark_tree_browser_cell.h" | 16 #import "chrome/browser/cocoa/bookmark_tree_browser_cell.h" |
| 17 #import "chrome/browser/cocoa/browser_window_controller.h" | 17 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 18 #include "chrome/browser/profile.h" | 18 #include "chrome/browser/profile.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 | 20 |
| 21 @interface BookmarkEditorBaseController () | 21 @interface BookmarkEditorBaseController () |
| 22 | 22 |
| 23 @property (retain, readwrite) NSArray* folderTreeArray; | |
| 24 | |
| 25 // Return the folder tree object for the given path. | 23 // Return the folder tree object for the given path. |
| 26 - (BookmarkFolderInfo*)folderForIndexPath:(NSIndexPath*)path; | 24 - (BookmarkFolderInfo*)folderForIndexPath:(NSIndexPath*)path; |
| 27 | 25 |
| 28 // (Re)build the folder tree from the BookmarkModel's current state. | 26 // (Re)build the folder tree from the BookmarkModel's current state. |
| 29 - (void)buildFolderTree; | 27 - (void)buildFolderTree; |
| 30 | 28 |
| 31 // Notifies the controller that the bookmark model has changed. | 29 // Notifies the controller that the bookmark model has changed. |
| 32 // |selection| specifies if the current selection should be | 30 // |selection| specifies if the current selection should be |
| 33 // maintained (usually YES). | 31 // maintained (usually YES). |
| 34 - (void)modelChangedPreserveSelection:(BOOL)preserve; | 32 - (void)modelChangedPreserveSelection:(BOOL)preserve; |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 592 } |
| 595 | 593 |
| 596 // Implementing isEqual: allows the NSTreeController to preserve the selection | 594 // Implementing isEqual: allows the NSTreeController to preserve the selection |
| 597 // and open/shut state of outline items when the data changes. | 595 // and open/shut state of outline items when the data changes. |
| 598 - (BOOL)isEqual:(id)other { | 596 - (BOOL)isEqual:(id)other { |
| 599 return [other isKindOfClass:[BookmarkFolderInfo class]] && | 597 return [other isKindOfClass:[BookmarkFolderInfo class]] && |
| 600 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; | 598 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; |
| 601 } | 599 } |
| 602 | 600 |
| 603 @end | 601 @end |
| OLD | NEW |