| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 // From here down: same logic as BookmarkBarFolderController. | 445 // From here down: same logic as BookmarkBarFolderController. |
| 446 // TODO(jrg): find a way to share these 4 non-comment lines? | 446 // TODO(jrg): find a way to share these 4 non-comment lines? |
| 447 // http://crbug.com/35966 | 447 // http://crbug.com/35966 |
| 448 | 448 |
| 449 // If already opened, then we exited but re-entered the button, so do nothing. | 449 // If already opened, then we exited but re-entered the button, so do nothing. |
| 450 if ([folderController_ parentButton] == sender) | 450 if ([folderController_ parentButton] == sender) |
| 451 return; | 451 return; |
| 452 // Else open a new one if it makes sense to do so. | 452 // Else open a new one if it makes sense to do so. |
| 453 if ([sender bookmarkNode]->is_folder()) | 453 if ([sender bookmarkNode]->is_folder()) |
| 454 [folderTarget_ openBookmarkFolderFromButton:sender]; | 454 [folderTarget_ openBookmarkFolderFromButton:sender]; |
| 455 #if 1 | 455 else { |
| 456 else | |
| 457 // We're over a non-folder bookmark so close any old folders. | 456 // We're over a non-folder bookmark so close any old folders. |
| 458 [self closeAllBookmarkFolders]; | 457 [folderController_ close]; |
| 459 #endif | 458 folderController_ = nil; |
| 459 } |
| 460 } | 460 } |
| 461 | 461 |
| 462 // BookmarkButtonDelegate protocol implementation. | 462 // BookmarkButtonDelegate protocol implementation. |
| 463 - (void)mouseExitedButton:(id)sender event:(NSEvent*)event { | 463 - (void)mouseExitedButton:(id)sender event:(NSEvent*)event { |
| 464 // Don't care; do nothing. | 464 // Don't care; do nothing. |
| 465 // This is different behavior that the folder menus. | 465 // This is different behavior that the folder menus. |
| 466 } | 466 } |
| 467 | 467 |
| 468 // Begin (or end) watching for a click outside this window. Unlike | 468 // Begin (or end) watching for a click outside this window. Unlike |
| 469 // normal NSWindows, bookmark folder "fake menu" windows do not become | 469 // normal NSWindows, bookmark folder "fake menu" windows do not become |
| (...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2146 // If this button is showing its menu then we need to move the menu, too. | 2146 // If this button is showing its menu then we need to move the menu, too. |
| 2147 if (button == [folderController_ parentButton]) | 2147 if (button == [folderController_ parentButton]) |
| 2148 [folderController_ offsetFolderMenuWindow:NSMakeSize(xOffset, 0.0)]; | 2148 [folderController_ offsetFolderMenuWindow:NSMakeSize(xOffset, 0.0)]; |
| 2149 } | 2149 } |
| 2150 --displayedButtonCount_; | 2150 --displayedButtonCount_; |
| 2151 [self reconfigureBookmarkBar]; | 2151 [self reconfigureBookmarkBar]; |
| 2152 } | 2152 } |
| 2153 } | 2153 } |
| 2154 | 2154 |
| 2155 @end | 2155 @end |
| OLD | NEW |