| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/bookmark_bar_controller.h" | 5 #import "chrome/browser/cocoa/bookmark_bar_controller.h" |
| 6 #include "app/l10n_util_mac.h" | 6 #include "app/l10n_util_mac.h" |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1626 - (void)setNodeForBarMenu { | 1626 - (void)setNodeForBarMenu { |
| 1627 const BookmarkNode* node = bookmarkModel_->GetBookmarkBarNode(); | 1627 const BookmarkNode* node = bookmarkModel_->GetBookmarkBarNode(); |
| 1628 BookmarkMenu* menu = static_cast<BookmarkMenu*>([[self view] menu]); | 1628 BookmarkMenu* menu = static_cast<BookmarkMenu*>([[self view] menu]); |
| 1629 | 1629 |
| 1630 // Make sure types are compatible | 1630 // Make sure types are compatible |
| 1631 DCHECK(sizeof(long long) == sizeof(int64)); | 1631 DCHECK(sizeof(long long) == sizeof(int64)); |
| 1632 [menu setRepresentedObject:[NSNumber numberWithLongLong:node->id()]]; | 1632 [menu setRepresentedObject:[NSNumber numberWithLongLong:node->id()]]; |
| 1633 } | 1633 } |
| 1634 | 1634 |
| 1635 - (void)beingDeleted:(BookmarkModel*)model { | 1635 - (void)beingDeleted:(BookmarkModel*)model { |
| 1636 [self clearBookmarkBar]; | 1636 // The browser may be being torn down; little is safe to do. As an |
| 1637 // example, it may not be safe to clear the pasteboard. |
| 1638 // http://crbug.com/38665 |
| 1637 } | 1639 } |
| 1638 | 1640 |
| 1639 // TODO(jrg): for now this is brute force. | 1641 // TODO(jrg): for now this is brute force. |
| 1640 - (void)nodeMoved:(BookmarkModel*)model | 1642 - (void)nodeMoved:(BookmarkModel*)model |
| 1641 oldParent:(const BookmarkNode*)oldParent oldIndex:(int)oldIndex | 1643 oldParent:(const BookmarkNode*)oldParent oldIndex:(int)oldIndex |
| 1642 newParent:(const BookmarkNode*)newParent newIndex:(int)newIndex { | 1644 newParent:(const BookmarkNode*)newParent newIndex:(int)newIndex { |
| 1643 [self loaded:model]; | 1645 [self loaded:model]; |
| 1644 } | 1646 } |
| 1645 | 1647 |
| 1646 // TODO(jrg): for now this is brute force. | 1648 // TODO(jrg): for now this is brute force. |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1911 [pboard addTypes:[NSArray arrayWithObject:kBookmarkButtonDragType] | 1913 [pboard addTypes:[NSArray arrayWithObject:kBookmarkButtonDragType] |
| 1912 owner:nil]; | 1914 owner:nil]; |
| 1913 [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] | 1915 [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] |
| 1914 forType:kBookmarkButtonDragType]; | 1916 forType:kBookmarkButtonDragType]; |
| 1915 } else { | 1917 } else { |
| 1916 NOTREACHED(); | 1918 NOTREACHED(); |
| 1917 } | 1919 } |
| 1918 } | 1920 } |
| 1919 | 1921 |
| 1920 @end | 1922 @end |
| OLD | NEW |