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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm

Issue 2014733003: Removing parsing of text from pasteboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compilation fix Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/drag_util.mm ('k') | chrome/browser/ui/cocoa/url_drop_target.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 number++, extension]; 654 number++, extension];
655 } 655 }
656 656
657 return candidateName; 657 return candidateName;
658 } 658 }
659 659
660 - (NSArray*)namesOfPromisedFilesDroppedAtDestination:(NSURL*)dropDestination { 660 - (NSArray*)namesOfPromisedFilesDroppedAtDestination:(NSURL*)dropDestination {
661 NSPasteboard* pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; 661 NSPasteboard* pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
662 NSFileManager* fileManager = [NSFileManager defaultManager]; 662 NSFileManager* fileManager = [NSFileManager defaultManager];
663 663
664 if (![pboard containsURLData]) 664 if (![pboard containsURLDataConvertingTextToURL:YES])
665 return NULL; 665 return NULL;
666 666
667 NSArray *urls = NULL; 667 NSArray *urls = NULL;
668 NSArray* titles = NULL; 668 NSArray* titles = NULL;
669 [pboard getURLs:&urls andTitles:&titles convertingFilenames:YES]; 669 [pboard getURLs:&urls
670 andTitles:&titles
671 convertingFilenames:YES
672 convertingTextToURL:YES];
670 673
671 NSString* urlStr = [urls objectAtIndex:0]; 674 NSString* urlStr = [urls objectAtIndex:0];
672 NSString* nameStr = [titles objectAtIndex:0]; 675 NSString* nameStr = [titles objectAtIndex:0];
673 676
674 NSString* nameWithExtensionStr = 677 NSString* nameWithExtensionStr =
675 UnusedLegalNameForNewDropFile(dropDestination, nameStr, @".webloc"); 678 UnusedLegalNameForNewDropFile(dropDestination, nameStr, @".webloc");
676 if (!nameWithExtensionStr) 679 if (!nameWithExtensionStr)
677 return NULL; 680 return NULL;
678 681
679 NSDictionary* urlDict = [NSDictionary dictionaryWithObject:urlStr 682 NSDictionary* urlDict = [NSDictionary dictionaryWithObject:urlStr
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 745
743 - (void)handleFocusEvent:(NSEvent*)event 746 - (void)handleFocusEvent:(NSEvent*)event
744 ofView:(AutocompleteTextField*)controlView { 747 ofView:(AutocompleteTextField*)controlView {
745 if ([controlView observer]) { 748 if ([controlView observer]) {
746 const bool controlDown = ([event modifierFlags] & NSControlKeyMask) != 0; 749 const bool controlDown = ([event modifierFlags] & NSControlKeyMask) != 0;
747 [controlView observer]->OnSetFocus(controlDown); 750 [controlView observer]->OnSetFocus(controlDown);
748 } 751 }
749 } 752 }
750 753
751 @end 754 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/drag_util.mm ('k') | chrome/browser/ui/cocoa/url_drop_target.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698