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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm

Issue 2324593002: [Mac] Fix for security indicator drag&drop navigation (Closed)
Patch Set: Fix for shrike Created 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
index 3b227f8bdecad182ef65e690c9565ee36011aa79..2b68af5582a59bf47a20868dde4f9ca0e46d1596 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm
@@ -513,12 +513,21 @@ const CGFloat kAnimationDuration = 0.2;
// TODO(viettrungluu): crbug.com/30809 -- this is a hack since it steals focus
// and doesn't return it.
[[self window] makeFirstResponder:self];
- return [dropHandler_ draggingEntered:sender];
+
+ bool canDropAtLocation =
+ [[self cell] canDropAtLocationInWindow:[sender draggingLocation]
+ ofView:self];
+ return canDropAtLocation ? [dropHandler_ draggingEntered:sender]
+ : NSDragOperationNone;
}
// (URLDropTarget protocol)
- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)sender {
- return [dropHandler_ draggingUpdated:sender];
+ bool canDropAtLocation =
+ [[self cell] canDropAtLocationInWindow:[sender draggingLocation]
+ ofView:self];
+ return canDropAtLocation ? [dropHandler_ draggingUpdated:sender]
+ : NSDragOperationNone;
}
// (URLDropTarget protocol)
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698