| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/location_bar/autocomplete_text_field_cell.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 number++, extension]; | 697 number++, extension]; |
| 698 } | 698 } |
| 699 | 699 |
| 700 return candidateName; | 700 return candidateName; |
| 701 } | 701 } |
| 702 | 702 |
| 703 - (NSArray*)namesOfPromisedFilesDroppedAtDestination:(NSURL*)dropDestination { | 703 - (NSArray*)namesOfPromisedFilesDroppedAtDestination:(NSURL*)dropDestination { |
| 704 NSPasteboard* pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; | 704 NSPasteboard* pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; |
| 705 NSFileManager* fileManager = [NSFileManager defaultManager]; | 705 NSFileManager* fileManager = [NSFileManager defaultManager]; |
| 706 | 706 |
| 707 if (![pboard containsURLData]) | 707 if (![pboard containsURLDataInTypeOrText]) |
| 708 return NULL; | 708 return NULL; |
| 709 | 709 |
| 710 NSArray *urls = NULL; | 710 NSArray *urls = NULL; |
| 711 NSArray* titles = NULL; | 711 NSArray* titles = NULL; |
| 712 [pboard getURLs:&urls andTitles:&titles convertingFilenames:YES]; | 712 [pboard getURLsFromTypeOrText:&urls |
| 713 andTitles:&titles |
| 714 convertingFilenames:YES]; |
| 713 | 715 |
| 714 NSString* urlStr = [urls objectAtIndex:0]; | 716 NSString* urlStr = [urls objectAtIndex:0]; |
| 715 NSString* nameStr = [titles objectAtIndex:0]; | 717 NSString* nameStr = [titles objectAtIndex:0]; |
| 716 | 718 |
| 717 NSString* nameWithExtensionStr = | 719 NSString* nameWithExtensionStr = |
| 718 UnusedLegalNameForNewDropFile(dropDestination, nameStr, @".webloc"); | 720 UnusedLegalNameForNewDropFile(dropDestination, nameStr, @".webloc"); |
| 719 if (!nameWithExtensionStr) | 721 if (!nameWithExtensionStr) |
| 720 return NULL; | 722 return NULL; |
| 721 | 723 |
| 722 NSDictionary* urlDict = [NSDictionary dictionaryWithObject:urlStr | 724 NSDictionary* urlDict = [NSDictionary dictionaryWithObject:urlStr |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 | 787 |
| 786 - (void)handleFocusEvent:(NSEvent*)event | 788 - (void)handleFocusEvent:(NSEvent*)event |
| 787 ofView:(AutocompleteTextField*)controlView { | 789 ofView:(AutocompleteTextField*)controlView { |
| 788 if ([controlView observer]) { | 790 if ([controlView observer]) { |
| 789 const bool controlDown = ([event modifierFlags] & NSControlKeyMask) != 0; | 791 const bool controlDown = ([event modifierFlags] & NSControlKeyMask) != 0; |
| 790 [controlView observer]->OnSetFocus(controlDown); | 792 [controlView observer]->OnSetFocus(controlDown); |
| 791 } | 793 } |
| 792 } | 794 } |
| 793 | 795 |
| 794 @end | 796 @end |
| OLD | NEW |