| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // counted as "outside" as well, because they should close bookmark folder | 512 // counted as "outside" as well, because they should close bookmark folder |
| 513 // menus as well. | 513 // menus as well. |
| 514 if (eventWindow == myWindow) { | 514 if (eventWindow == myWindow) { |
| 515 NSView* hitView = | 515 NSView* hitView = |
| 516 [[eventWindow contentView] hitTest:[event locationInWindow]]; | 516 [[eventWindow contentView] hitTest:[event locationInWindow]]; |
| 517 if (![hitView isDescendantOf:[self view]] || hitView == buttonView_) | 517 if (![hitView isDescendantOf:[self view]] || hitView == buttonView_) |
| 518 return YES; | 518 return YES; |
| 519 } | 519 } |
| 520 // If a click in a bookmark bar folder window and that isn't | 520 // If a click in a bookmark bar folder window and that isn't |
| 521 // one of my bookmark bar folders, YES is click outside. | 521 // one of my bookmark bar folders, YES is click outside. |
| 522 if ([eventWindow isKindOfClass:[BookmarkBarFolderWindow | 522 if (![eventWindow isKindOfClass:[BookmarkBarFolderWindow |
| 523 class]] && | 523 class]]) { |
| 524 [eventWindow parentWindow] != myWindow) { | |
| 525 return YES; | 524 return YES; |
| 526 } | 525 } |
| 527 break; | 526 break; |
| 528 default: | 527 default: |
| 529 break; | 528 break; |
| 530 } | 529 } |
| 531 return NO; | 530 return NO; |
| 532 } | 531 } |
| 533 | 532 |
| 534 // Exposed for testing. | 533 // Exposed for testing. |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 [pboard addTypes:[NSArray arrayWithObject:kBookmarkButtonDragType] | 1922 [pboard addTypes:[NSArray arrayWithObject:kBookmarkButtonDragType] |
| 1924 owner:nil]; | 1923 owner:nil]; |
| 1925 [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] | 1924 [pboard setData:[NSData dataWithBytes:&button length:sizeof(button)] |
| 1926 forType:kBookmarkButtonDragType]; | 1925 forType:kBookmarkButtonDragType]; |
| 1927 } else { | 1926 } else { |
| 1928 NOTREACHED(); | 1927 NOTREACHED(); |
| 1929 } | 1928 } |
| 1930 } | 1929 } |
| 1931 | 1930 |
| 1932 @end | 1931 @end |
| OLD | NEW |