| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_view.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" | 7 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h" |
| 8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Need an update if the indicator wasn't previously shown or if it has | 148 // Need an update if the indicator wasn't previously shown or if it has |
| 149 // moved. | 149 // moved. |
| 150 if (!dropIndicatorShown_ || dropIndicatorPosition_ != x) { | 150 if (!dropIndicatorShown_ || dropIndicatorPosition_ != x) { |
| 151 dropIndicatorShown_ = YES; | 151 dropIndicatorShown_ = YES; |
| 152 dropIndicatorPosition_ = x; | 152 dropIndicatorPosition_ = x; |
| 153 [self dropIndicatorChanged]; | 153 [self dropIndicatorChanged]; |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 [controller_ draggingEntered:info]; // allow hover-open to work. | 157 [controller_ draggingEntered:info]; // allow hover-open to work. |
| 158 return [info draggingSource] ? NSDragOperationMove : NSDragOperationCopy; | 158 return [[info draggingSource] isKindOfClass: [BookmarkButton class]] ? |
| 159 NSDragOperationMove : NSDragOperationCopy; |
| 159 } | 160 } |
| 160 return NSDragOperationNone; | 161 return NSDragOperationNone; |
| 161 } | 162 } |
| 162 | 163 |
| 163 - (void)draggingExited:(id<NSDraggingInfo>)info { | 164 - (void)draggingExited:(id<NSDraggingInfo>)info { |
| 164 // Regardless of the type of dragging which ended, we need to get rid of the | 165 // Regardless of the type of dragging which ended, we need to get rid of the |
| 165 // drop indicator if one was shown. | 166 // drop indicator if one was shown. |
| 166 if (dropIndicatorShown_) { | 167 if (dropIndicatorShown_) { |
| 167 dropIndicatorShown_ = NO; | 168 dropIndicatorShown_ = NO; |
| 168 [self dropIndicatorChanged]; | 169 [self dropIndicatorChanged]; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 244 |
| 244 - (void)setController:(id)controller { | 245 - (void)setController:(id)controller { |
| 245 controller_ = controller; | 246 controller_ = controller; |
| 246 } | 247 } |
| 247 | 248 |
| 248 - (ViewID)viewID { | 249 - (ViewID)viewID { |
| 249 return VIEW_ID_BOOKMARK_BAR; | 250 return VIEW_ID_BOOKMARK_BAR; |
| 250 } | 251 } |
| 251 | 252 |
| 252 @end // @implementation BookmarkBarView | 253 @end // @implementation BookmarkBarView |
| OLD | NEW |