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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/mac/sdk_forward_declarations.h" | 10 #include "base/mac/sdk_forward_declarations.h" |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
858 | 858 |
859 // Configure the off-the-side button (e.g. specify the node range, | 859 // Configure the off-the-side button (e.g. specify the node range, |
860 // check if we should enable or disable it, etc). | 860 // check if we should enable or disable it, etc). |
861 - (void)configureOffTheSideButtonContentsAndVisibility { | 861 - (void)configureOffTheSideButtonContentsAndVisibility { |
862 [[offTheSideButton_ cell] setStartingChildIndex:displayedButtonCount_]; | 862 [[offTheSideButton_ cell] setStartingChildIndex:displayedButtonCount_]; |
863 [[offTheSideButton_ cell] | 863 [[offTheSideButton_ cell] |
864 setBookmarkNode:bookmarkModel_->bookmark_bar_node()]; | 864 setBookmarkNode:bookmarkModel_->bookmark_bar_node()]; |
865 int bookmarkChildren = bookmarkModel_->bookmark_bar_node()->child_count(); | 865 int bookmarkChildren = bookmarkModel_->bookmark_bar_node()->child_count(); |
866 if (bookmarkChildren > displayedButtonCount_) { | 866 if (bookmarkChildren > displayedButtonCount_) { |
867 [offTheSideButton_ setHidden:NO]; | 867 [offTheSideButton_ setHidden:NO]; |
868 [offTheSideButton_ setNeedsDisplay:YES]; | |
erikchen
2016/01/25 14:51:05
Does your CL still fix the problem if we only call
Alexei Svitkine (slow)
2016/01/25 17:34:59
Unfortunately, that doesn't work (on its own). The
| |
868 } else { | 869 } else { |
869 // If we just deleted the last item in an off-the-side menu so the | 870 // If we just deleted the last item in an off-the-side menu so the |
870 // button will be going away, make sure the menu goes away. | 871 // button will be going away, make sure the menu goes away. |
871 if (folderController_ && | 872 if (folderController_ && |
872 ([folderController_ parentButton] == offTheSideButton_)) | 873 ([folderController_ parentButton] == offTheSideButton_)) |
873 [self closeAllBookmarkFolders]; | 874 [self closeAllBookmarkFolders]; |
874 // (And hide the button, too.) | 875 // (And hide the button, too.) |
875 [offTheSideButton_ setHidden:YES]; | 876 [offTheSideButton_ setHidden:YES]; |
876 } | 877 } |
877 } | 878 } |
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2940 - (id<BookmarkButtonControllerProtocol>)controllerForNode: | 2941 - (id<BookmarkButtonControllerProtocol>)controllerForNode: |
2941 (const BookmarkNode*)node { | 2942 (const BookmarkNode*)node { |
2942 // See if it's in the bar, then if it is in the hierarchy of visible | 2943 // See if it's in the bar, then if it is in the hierarchy of visible |
2943 // folder menus. | 2944 // folder menus. |
2944 if (bookmarkModel_->bookmark_bar_node() == node) | 2945 if (bookmarkModel_->bookmark_bar_node() == node) |
2945 return self; | 2946 return self; |
2946 return [folderController_ controllerForNode:node]; | 2947 return [folderController_ controllerForNode:node]; |
2947 } | 2948 } |
2948 | 2949 |
2949 @end | 2950 @end |
OLD | NEW |