OLD | NEW |
---|---|
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/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" // IDC_* | 9 #include "chrome/app/chrome_command_ids.h" // IDC_* |
10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 | 52 |
53 - (id)initWithFrame:(NSRect)frameRect { | 53 - (id)initWithFrame:(NSRect)frameRect { |
54 if ((self = [super initWithFrame:frameRect])) { | 54 if ((self = [super initWithFrame:frameRect])) { |
55 dropHandler_.reset([[URLDropTargetHandler alloc] initWithView:self]); | 55 dropHandler_.reset([[URLDropTargetHandler alloc] initWithView:self]); |
56 | 56 |
57 forbiddenCharacters_.reset([[NSCharacterSet controlCharacterSet] retain]); | 57 forbiddenCharacters_.reset([[NSCharacterSet controlCharacterSet] retain]); |
58 | 58 |
59 // These checks seem inappropriate to the omnibox, and also | 59 // These checks seem inappropriate to the omnibox, and also |
60 // unlikely to work reliably due to our autocomplete interfering. | 60 // unlikely to work reliably due to our autocomplete interfering. |
61 // | 61 // |
62 // Also see <http://crbug.com/173405>. | 62 // Also see http://crbug.com/173405 and http://crbug.com/528014. |
63 NSTextCheckingTypes checkingTypes = [self enabledTextCheckingTypes]; | 63 NSTextCheckingTypes checkingTypes = [self enabledTextCheckingTypes]; |
64 checkingTypes &= ~NSTextCheckingTypeReplacement; | 64 checkingTypes &= ~NSTextCheckingTypeReplacement; |
65 checkingTypes &= ~NSTextCheckingTypeCorrection; | 65 checkingTypes &= ~NSTextCheckingTypeCorrection; |
66 checkingTypes &= ~NSTextCheckingTypeQuote; | |
67 checkingTypes &= ~NSTextCheckingTypeDash; | |
Scott Hess - ex-Googler
2015/09/09 15:55:04
I support going for broke and disabling all intrus
Robert Sesek
2015/09/09 22:38:25
I'm OK with this, too, though. I don't feel strong
groby-ooo-7-16
2015/09/12 00:53:46
FWIW, Safari lets you pick which substitutions you
| |
66 [self setEnabledTextCheckingTypes:checkingTypes]; | 68 [self setEnabledTextCheckingTypes:checkingTypes]; |
67 } | 69 } |
68 return self; | 70 return self; |
69 } | 71 } |
70 | 72 |
71 // If the entire field is selected, drag the same data as would be | 73 // If the entire field is selected, drag the same data as would be |
72 // dragged from the field's location icon. In some cases the textual | 74 // dragged from the field's location icon. In some cases the textual |
73 // contents will not contain relevant data (for instance, "http://" is | 75 // contents will not contain relevant data (for instance, "http://" is |
74 // stripped from URLs). | 76 // stripped from URLs). |
75 - (BOOL)dragSelectionWithEvent:(NSEvent *)event | 77 - (BOOL)dragSelectionWithEvent:(NSEvent *)event |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 [[self delegate] suggestText], | 548 [[self delegate] suggestText], |
547 [[self delegate] suggestColor], | 549 [[self delegate] suggestColor], |
548 self, | 550 self, |
549 [self bounds]); | 551 [self bounds]); |
550 AutocompleteTextFieldObserver* observer = [self observer]; | 552 AutocompleteTextFieldObserver* observer = [self observer]; |
551 if (observer) | 553 if (observer) |
552 observer->OnDidDrawRect(); | 554 observer->OnDidDrawRect(); |
553 } | 555 } |
554 | 556 |
555 @end | 557 @end |
OLD | NEW |