| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/autocomplete_text_field_editor.h" | 5 #import "chrome/browser/cocoa/autocomplete_text_field_editor.h" |
| 6 | 6 |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 DCHECK([field isKindOfClass:[AutocompleteTextField class]]); | 182 DCHECK([field isKindOfClass:[AutocompleteTextField class]]); |
| 183 // Give the text field ownership of the visibility lock. | 183 // Give the text field ownership of the visibility lock. |
| 184 [[BrowserWindowController browserWindowControllerForView:field] | 184 [[BrowserWindowController browserWindowControllerForView:field] |
| 185 releaseBarVisibilityForOwner:field withAnimation:YES delay:YES]; | 185 releaseBarVisibilityForOwner:field withAnimation:YES delay:YES]; |
| 186 } | 186 } |
| 187 return doResign; | 187 return doResign; |
| 188 } | 188 } |
| 189 | 189 |
| 190 // (URLDropTarget protocol) | 190 // (URLDropTarget protocol) |
| 191 - (id<URLDropTargetController>)urlDropController { | 191 - (id<URLDropTargetController>)urlDropController { |
| 192 BrowserWindowController* windowController = [[self window] windowController]; | 192 BrowserWindowController* windowController = |
| 193 DCHECK([windowController isKindOfClass:[BrowserWindowController class]]); | 193 [BrowserWindowController browserWindowControllerForView:self]; |
| 194 return [windowController toolbarController]; | 194 return [windowController toolbarController]; |
| 195 } | 195 } |
| 196 | 196 |
| 197 // (URLDropTarget protocol) | 197 // (URLDropTarget protocol) |
| 198 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender { | 198 - (NSDragOperation)draggingEntered:(id<NSDraggingInfo>)sender { |
| 199 // Make ourself the first responder (even though we're presumably already the | 199 // Make ourself the first responder (even though we're presumably already the |
| 200 // first responder), which will select the text to indicate that our contents | 200 // first responder), which will select the text to indicate that our contents |
| 201 // would be replaced by a drop. | 201 // would be replaced by a drop. |
| 202 [[self window] makeFirstResponder:self]; | 202 [[self window] makeFirstResponder:self]; |
| 203 return [dropHandler_ draggingEntered:sender]; | 203 return [dropHandler_ draggingEntered:sender]; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 // TODO(shess): Beep on empty? I hate beeps, though. | 242 // TODO(shess): Beep on empty? I hate beeps, though. |
| 243 // NOTE: If |aString| is empty, this intentionally replaces the | 243 // NOTE: If |aString| is empty, this intentionally replaces the |
| 244 // selection with empty. This seems consistent with the case where | 244 // selection with empty. This seems consistent with the case where |
| 245 // the input contained a mixture of characters and the string ended | 245 // the input contained a mixture of characters and the string ended |
| 246 // up not empty. | 246 // up not empty. |
| 247 [super insertText:aString]; | 247 [super insertText:aString]; |
| 248 } | 248 } |
| 249 | 249 |
| 250 @end | 250 @end |
| OLD | NEW |