Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4044)

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

Issue 583223002: Open just folder menu on middle clicking chevron button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes addressing comments. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index 685c00b4fbba6ac07dbeb5646403cb7e904c5d0d..b5f17bbc80a192eb30a924243514284ae99bf0a3 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -716,13 +716,28 @@ void RecordAppLaunch(Profile* profile, GURL url) {
RecordBookmarkFolderOpen([self bookmarkLaunchLocation]);
showFolderMenus_ = !showFolderMenus_;
- if (sender == offTheSideButton_)
+ // Middle click on chevron should not open bookmarks under it, instead just
+ // open its folder menu.
+ if (sender == offTheSideButton_) {
[[sender cell] setStartingChildIndex:displayedButtonCount_];
-
+ NSEvent* event = [NSApp currentEvent];
+ if ([event type] == NSOtherMouseUp) {
+ [self openOrCloseBookmarkFolderForOffTheSideButton];
+ return;
+ }
+ }
// Toggle presentation of bar folder menus.
[folderTarget_ openBookmarkFolderFromButton:sender];
}
+- (void)openOrCloseBookmarkFolderForOffTheSideButton {
+ // If clicked on already opened folder, then close it and return.
+ if ([folderController_ parentButton] == offTheSideButton_)
+ [self closeBookmarkFolder:self];
+ else
+ [self addNewFolderControllerWithParentButton:offTheSideButton_];
+}
+
// Click on a bookmark folder button.
- (IBAction)openBookmarkFolderFromButton:(id)sender {
[self openBookmarkFolder:sender];

Powered by Google App Engine
This is Rietveld 408576698