| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" | 7 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.h" |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 url:details.url | 85 url:details.url |
| 86 title:details.title | 86 title:details.title |
| 87 configuration:configuration]; | 87 configuration:configuration]; |
| 88 } | 88 } |
| 89 [controller runAsModalSheet]; | 89 [controller runAsModalSheet]; |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Adapter to tell BookmarkEditorBaseController when bookmarks change. | 92 // Adapter to tell BookmarkEditorBaseController when bookmarks change. |
| 93 class BookmarkEditorBaseControllerBridge : public BookmarkModelObserver { | 93 class BookmarkEditorBaseControllerBridge : public BookmarkModelObserver { |
| 94 public: | 94 public: |
| 95 BookmarkEditorBaseControllerBridge(BookmarkEditorBaseController* controller) | 95 explicit BookmarkEditorBaseControllerBridge( |
| 96 BookmarkEditorBaseController* controller) |
| 96 : controller_(controller), | 97 : controller_(controller), |
| 97 importing_(false) | 98 importing_(false) |
| 98 { } | 99 { } |
| 99 | 100 |
| 100 virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE { | 101 virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE { |
| 101 [controller_ modelChangedPreserveSelection:YES]; | 102 [controller_ modelChangedPreserveSelection:YES]; |
| 102 } | 103 } |
| 103 | 104 |
| 104 virtual void BookmarkNodeMoved(BookmarkModel* model, | 105 virtual void BookmarkNodeMoved(BookmarkModel* model, |
| 105 const BookmarkNode* old_parent, | 106 const BookmarkNode* old_parent, |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 } | 678 } |
| 678 | 679 |
| 679 // Implementing isEqual: allows the NSTreeController to preserve the selection | 680 // Implementing isEqual: allows the NSTreeController to preserve the selection |
| 680 // and open/shut state of outline items when the data changes. | 681 // and open/shut state of outline items when the data changes. |
| 681 - (BOOL)isEqual:(id)other { | 682 - (BOOL)isEqual:(id)other { |
| 682 return [other isKindOfClass:[BookmarkFolderInfo class]] && | 683 return [other isKindOfClass:[BookmarkFolderInfo class]] && |
| 683 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; | 684 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; |
| 684 } | 685 } |
| 685 | 686 |
| 686 @end | 687 @end |
| OLD | NEW |