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

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

Issue 8890029: [Mac] Wire "Paste and Match Style" to -paste: in omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | Annotate | Revision Log
« 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/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
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
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
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