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/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return; | 154 return; |
155 } | 155 } |
156 | 156 |
157 AutocompleteTextFieldObserver* observer = [self observer]; | 157 AutocompleteTextFieldObserver* observer = [self observer]; |
158 DCHECK(observer); | 158 DCHECK(observer); |
159 if (observer) { | 159 if (observer) { |
160 observer->OnPaste(); | 160 observer->OnPaste(); |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
| 164 - (void)pasteAndMatchStyle:(id)sender { |
| 165 [self paste:sender]; |
| 166 } |
| 167 |
164 - (void)pasteAndGo:sender { | 168 - (void)pasteAndGo:sender { |
165 if (ThePasteboardIsTooDamnBig()) { | 169 if (ThePasteboardIsTooDamnBig()) { |
166 NSBeep(); | 170 NSBeep(); |
167 return; | 171 return; |
168 } | 172 } |
169 | 173 |
170 AutocompleteTextFieldObserver* observer = [self observer]; | 174 AutocompleteTextFieldObserver* observer = [self observer]; |
171 DCHECK(observer); | 175 DCHECK(observer); |
172 if (observer) { | 176 if (observer) { |
173 observer->OnPasteAndGo(); | 177 observer->OnPasteAndGo(); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 NSAttributedString* selection = | 490 NSAttributedString* selection = |
487 [self attributedSubstringForProposedRange:selectedRange | 491 [self attributedSubstringForProposedRange:selectedRange |
488 actualRange:NULL]; | 492 actualRange:NULL]; |
489 if (!selection) | 493 if (!selection) |
490 return; | 494 return; |
491 | 495 |
492 [[FindPasteboard sharedInstance] setFindText:[selection string]]; | 496 [[FindPasteboard sharedInstance] setFindText:[selection string]]; |
493 } | 497 } |
494 | 498 |
495 @end | 499 @end |
OLD | NEW |