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

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

Issue 264037: Refactor security-icon code to a more general form (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chrome/browser/cocoa/autocomplete_text_field.h" 5 #include "chrome/browser/cocoa/autocomplete_text_field.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/cocoa/autocomplete_text_field_cell.h" 8 #include "chrome/browser/cocoa/autocomplete_text_field_cell.h"
9 9
10 @implementation AutocompleteTextField 10 @implementation AutocompleteTextField
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 NSEvent* currentEvent = [NSApp currentEvent]; 136 NSEvent* currentEvent = [NSApp currentEvent];
137 if ([currentEvent type] == NSLeftMouseUp && 137 if ([currentEvent type] == NSLeftMouseUp &&
138 ![editor selectedRange].length) { 138 ![editor selectedRange].length) {
139 [editor selectAll:nil]; 139 [editor selectAll:nil];
140 } 140 }
141 } 141 }
142 142
143 return; 143 return;
144 } 144 }
145 145
146 // Check to see if the user clicked the hint icon in the cell. If so, we need 146 // Check to see if the user clicked the security hint icon in the cell. If so,
147 // to display the page info window. 147 // we need to display the page info window.
148 const NSRect hintIconFrame = [cell hintImageFrameForFrame:[self bounds]]; 148 const NSRect hintIconFrame = [cell securityImageFrameForFrame:[self bounds]];
149 if (NSMouseInRect(location, hintIconFrame, [self isFlipped])) { 149 if (NSMouseInRect(location, hintIconFrame, [self isFlipped])) {
150 observer_->OnSecurityIconClicked(); 150 [cell onSecurityIconMousePressed];
151 return; 151 return;
152 } 152 }
153 153
154 NSText* editor = [self currentEditor]; 154 NSText* editor = [self currentEditor];
155 155
156 // We should only be here if we accepted first-responder status and 156 // We should only be here if we accepted first-responder status and
157 // have a field editor. If one of these fires, it means some 157 // have a field editor. If one of these fires, it means some
158 // assumptions are being broken. 158 // assumptions are being broken.
159 DCHECK(editor != nil); 159 DCHECK(editor != nil);
160 DCHECK([editor isDescendantOf:self]); 160 DCHECK([editor isDescendantOf:self]);
(...skipping 21 matching lines...) Expand all
182 } 182 }
183 183
184 - (void)setFrame:(NSRect)frameRect { 184 - (void)setFrame:(NSRect)frameRect {
185 [super setFrame:frameRect]; 185 [super setFrame:frameRect];
186 if (observer_) { 186 if (observer_) {
187 observer_->OnFrameChanged(); 187 observer_->OnFrameChanged();
188 } 188 }
189 } 189 }
190 190
191 @end 191 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field.h ('k') | chrome/browser/cocoa/autocomplete_text_field_cell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698