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

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

Issue 1862623004: mac: Fix size of dragged image from omnibox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | 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) 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/location_bar/autocomplete_text_field_editor.h" 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h"
6 6
7 #include "base/mac/sdk_forward_declarations.h" 7 #include "base/mac/sdk_forward_declarations.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" // IDC_* 10 #include "chrome/app/chrome_command_ids.h" // IDC_*
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 AutocompleteTextFieldObserver* observer = [self observer]; 113 AutocompleteTextFieldObserver* observer = [self observer];
114 DCHECK(observer); 114 DCHECK(observer);
115 if (observer && observer->CanCopy()) { 115 if (observer && observer->CanCopy()) {
116 NSPoint p; 116 NSPoint p;
117 NSImage* image = [self dragImageForSelectionWithEvent:event origin:&p]; 117 NSImage* image = [self dragImageForSelectionWithEvent:event origin:&p];
118 118
119 base::scoped_nsobject<NSPasteboardItem> item( 119 base::scoped_nsobject<NSPasteboardItem> item(
120 observer->CreatePasteboardItem()); 120 observer->CreatePasteboardItem());
121 base::scoped_nsobject<NSDraggingItem> dragItem( 121 base::scoped_nsobject<NSDraggingItem> dragItem(
122 [[NSDraggingItem alloc] initWithPasteboardWriter:item]); 122 [[NSDraggingItem alloc] initWithPasteboardWriter:item]);
123 [dragItem setDraggingFrame:[self bounds] contents:image]; 123 NSRect draggingFrame =
124 NSMakeRect(0, 0, image.size.width, image.size.height);
125 [dragItem setDraggingFrame:draggingFrame contents:image];
124 [self beginDraggingSessionWithItems:@[ dragItem.get() ] 126 [self beginDraggingSessionWithItems:@[ dragItem.get() ]
125 event:event 127 event:event
126 source:self]; 128 source:self];
127 DCHECK(!gInDrag); 129 DCHECK(!gInDrag);
128 gInDrag = true; 130 gInDrag = true;
129 while (gInDrag) { 131 while (gInDrag) {
130 [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode 132 [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
131 beforeDate:[NSDate distantFuture]]; 133 beforeDate:[NSDate distantFuture]];
132 } 134 }
133 135
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 [[self delegate] suggestText], 586 [[self delegate] suggestText],
585 [[self delegate] suggestColor], 587 [[self delegate] suggestColor],
586 self, 588 self,
587 [self bounds]); 589 [self bounds]);
588 AutocompleteTextFieldObserver* observer = [self observer]; 590 AutocompleteTextFieldObserver* observer = [self observer];
589 if (observer) 591 if (observer)
590 observer->OnDidDrawRect(); 592 observer->OnDidDrawRect();
591 } 593 }
592 594
593 @end 595 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698