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 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
6 | 6 |
7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2799 [oldButton removeFromSuperview]; | 2799 [oldButton removeFromSuperview]; |
2800 [buttons_ removeObjectAtIndex:buttonIndex]; | 2800 [buttons_ removeObjectAtIndex:buttonIndex]; |
2801 --displayedButtonCount_; | 2801 --displayedButtonCount_; |
2802 [self resetAllButtonPositionsWithAnimation:YES]; | 2802 [self resetAllButtonPositionsWithAnimation:YES]; |
2803 [self reconfigureBookmarkBar]; | 2803 [self reconfigureBookmarkBar]; |
2804 } else if (folderController_ && | 2804 } else if (folderController_ && |
2805 [folderController_ parentButton] == offTheSideButton_) { | 2805 [folderController_ parentButton] == offTheSideButton_) { |
2806 // The button being removed is in the OTS (off-the-side) and the OTS | 2806 // The button being removed is in the OTS (off-the-side) and the OTS |
2807 // menu is showing so we need to remove the button. | 2807 // menu is showing so we need to remove the button. |
2808 NSInteger index = buttonIndex - displayedButtonCount_; | 2808 NSInteger index = buttonIndex - displayedButtonCount_; |
2809 [folderController_ removeButton:index animate:YES]; | 2809 [folderController_ removeButton:index animate:animate]; |
2810 } | 2810 } |
2811 } | 2811 } |
2812 | 2812 |
2813 - (id<BookmarkButtonControllerProtocol>)controllerForNode: | 2813 - (id<BookmarkButtonControllerProtocol>)controllerForNode: |
2814 (const BookmarkNode*)node { | 2814 (const BookmarkNode*)node { |
2815 // See if it's in the bar, then if it is in the hierarchy of visible | 2815 // See if it's in the bar, then if it is in the hierarchy of visible |
2816 // folder menus. | 2816 // folder menus. |
2817 if (bookmarkModel_->bookmark_bar_node() == node) | 2817 if (bookmarkModel_->bookmark_bar_node() == node) |
2818 return self; | 2818 return self; |
2819 return [folderController_ controllerForNode:node]; | 2819 return [folderController_ controllerForNode:node]; |
2820 } | 2820 } |
2821 | 2821 |
2822 @end | 2822 @end |
OLD | NEW |