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

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

Issue 2232863002: Remove search::GetSearchTerms since it always returns empty string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_query_extract
Patch Set: Android Created 4 years, 4 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
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.h" 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/mac_util.h" 8 #import "base/mac/mac_util.h"
9 #import "base/mac/sdk_forward_declarations.h" 9 #import "base/mac/sdk_forward_declarations.h"
10 #include "chrome/browser/themes/theme_service.h" 10 #include "chrome/browser/themes/theme_service.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // select the entire field. 152 // select the entire field.
153 // NOTE(shess): This does not interfere with single-clicking to 153 // NOTE(shess): This does not interfere with single-clicking to
154 // place caret after a selection is made. An NSTextField only has 154 // place caret after a selection is made. An NSTextField only has
155 // a selection when it has a field editor. The field editor is an 155 // a selection when it has a field editor. The field editor is an
156 // NSText subview, which will receive the -mouseDown: in that 156 // NSText subview, which will receive the -mouseDown: in that
157 // case, and this code will never fire. 157 // case, and this code will never fire.
158 NSText* editor = [self currentEditor]; 158 NSText* editor = [self currentEditor];
159 if (editor) { 159 if (editor) {
160 NSEvent* currentEvent = [NSApp currentEvent]; 160 NSEvent* currentEvent = [NSApp currentEvent];
161 if ([currentEvent type] == NSLeftMouseUp && 161 if ([currentEvent type] == NSLeftMouseUp &&
162 ![editor selectedRange].length && 162 ![editor selectedRange].length) {
163 (!observer_ || observer_->ShouldSelectAllOnMouseDown())) {
164 [editor selectAll:nil]; 163 [editor selectAll:nil];
165 } 164 }
166 } 165 }
167 166
168 return; 167 return;
169 } 168 }
170 169
171 // Give the cell a chance to intercept clicks in page-actions and 170 // Give the cell a chance to intercept clicks in page-actions and
172 // other decorative items. 171 // other decorative items.
173 if ([cell mouseDown:theEvent inRect:bounds ofView:self]) { 172 if ([cell mouseDown:theEvent inRect:bounds ofView:self]) {
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 NSMinY(frame), 584 NSMinY(frame),
586 suggestWidth, 585 suggestWidth,
587 NSHeight(frame)); 586 NSHeight(frame));
588 587
589 gfx::ScopedNSGraphicsContextSaveGState saveGState; 588 gfx::ScopedNSGraphicsContextSaveGState saveGState;
590 NSRectClip(suggestRect); 589 NSRectClip(suggestRect);
591 [cell drawInteriorWithFrame:frame inView:controlView]; 590 [cell drawInteriorWithFrame:frame inView:controlView];
592 } 591 }
593 592
594 } // namespace autocomplete_text_field 593 } // namespace autocomplete_text_field
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698