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_folder_view.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_view.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.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_folder_target.h" | 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" |
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Virtually identical to [BookmarkBarView draggingEntered:]. | 51 // Virtually identical to [BookmarkBarView draggingEntered:]. |
52 // TODO(jrg): find a way to share code. Lack of multiple inheritance | 52 // TODO(jrg): find a way to share code. Lack of multiple inheritance |
53 // makes things more of a pain but there should be no excuse for laziness. | 53 // makes things more of a pain but there should be no excuse for laziness. |
54 // http://crbug.com/35966 | 54 // http://crbug.com/35966 |
55 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)info { | 55 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)info { |
56 inDrag_ = YES; | 56 inDrag_ = YES; |
57 if (![[self controller] draggingAllowed:info]) | 57 if (![[self controller] draggingAllowed:info]) |
58 return NSDragOperationNone; | 58 return NSDragOperationNone; |
59 if ([[info draggingPasteboard] dataForType:kBookmarkButtonDragType] || | 59 if ([[info draggingPasteboard] dataForType:kBookmarkButtonDragType] || |
60 PasteboardContainsBookmarks(ui::CLIPBOARD_TYPE_DRAG) || | 60 bookmarks::PasteboardContainsBookmarks(ui::CLIPBOARD_TYPE_DRAG) || |
61 [[info draggingPasteboard] containsURLData]) { | 61 [[info draggingPasteboard] containsURLData]) { |
62 // Find the position of the drop indicator. | 62 // Find the position of the drop indicator. |
63 BOOL showIt = [[self controller] | 63 BOOL showIt = [[self controller] |
64 shouldShowIndicatorShownForPoint:[info draggingLocation]]; | 64 shouldShowIndicatorShownForPoint:[info draggingLocation]]; |
65 if (!showIt) { | 65 if (!showIt) { |
66 [self setDropIndicatorShown:NO]; | 66 [self setDropIndicatorShown:NO]; |
67 } else { | 67 } else { |
68 [self setDropIndicatorShown:YES]; | 68 [self setDropIndicatorShown:YES]; |
69 | 69 |
70 CGFloat y = [[self controller] | 70 CGFloat y = [[self controller] |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 [dropIndicator_ setBorderType:NSLineBorder]; | 200 [dropIndicator_ setBorderType:NSLineBorder]; |
201 [dropIndicator_ setAlphaValue:0.85]; | 201 [dropIndicator_ setAlphaValue:0.85]; |
202 [self addSubview:dropIndicator_]; | 202 [self addSubview:dropIndicator_]; |
203 } else { | 203 } else { |
204 [dropIndicator_ removeFromSuperview]; | 204 [dropIndicator_ removeFromSuperview]; |
205 dropIndicator_.reset(); | 205 dropIndicator_.reset(); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 @end | 209 @end |
OLD | NEW |