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

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: 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..4ae686eab767f89a7d7302d598f4728e7ac60729 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -716,13 +716,29 @@ 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 openFolderForOffTheSideButton:sender];
+ return;
+ }
+ }
// Toggle presentation of bar folder menus.
[folderTarget_ openBookmarkFolderFromButton:sender];
}
+// Function to open bookmark folder of offTheSideButton.
Alexei Svitkine (slow) 2014/09/19 15:49:59 Nit: This comment doesn't add anything that the na
Gaja 2014/09/20 05:35:44 Acknowledged.
Gaja 2014/09/22 03:34:40 Done.
+- (void)openFolderForOffTheSideButton:(id)sender {
Alexei Svitkine (slow) 2014/09/19 15:49:59 Nit: Since this can close it too, how about "openO
Gaja 2014/09/20 05:35:44 Acknowledged.
Gaja 2014/09/22 03:34:40 Done.
+ // If clicked on already opened folder, then close it and return.
+ if ([folderController_ parentButton] == sender)
Alexei Svitkine (slow) 2014/09/19 15:49:59 From the code, looks like |sender| will always be
Gaja 2014/09/20 05:35:44 Acknowledged.
Gaja 2014/09/22 03:34:40 Done.
+ [self closeBookmarkFolder:self];
+ else
+ [self addNewFolderControllerWithParentButton:sender];
+}
+
// Click on a bookmark folder button.
- (IBAction)openBookmarkFolderFromButton:(id)sender {
[self openBookmarkFolder:sender];

Powered by Google App Engine
This is Rietveld 408576698