OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/autofill/autofill_details_container.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_view_delegate.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 [[errorBubbleController_ bubble] setAlignment: | 200 [[errorBubbleController_ bubble] setAlignment: |
201 info_bubble::kAlignLeftEdgeToAnchorEdge]; | 201 info_bubble::kAlignLeftEdgeToAnchorEdge]; |
202 } | 202 } |
203 [errorBubbleController_ setAnchorPoint: | 203 [errorBubbleController_ setAnchorPoint: |
204 [parentWindow convertBaseToScreen:anchorPoint]]; | 204 [parentWindow convertBaseToScreen:anchorPoint]]; |
205 | 205 |
206 [errorBubbleController_ showWindow:self]; | 206 [errorBubbleController_ showWindow:self]; |
207 } | 207 } |
208 | 208 |
209 - (void)hideErrorBubble { | 209 - (void)hideErrorBubble { |
210 [errorBubble_ setHidden:YES]; | 210 [errorBubbleController_ close]; |
211 } | 211 } |
212 | 212 |
213 - (void)updateMessageForField:(NSControl<AutofillInputField>*)field { | 213 - (void)updateMessageForField:(NSControl<AutofillInputField>*)field { |
214 // Ignore fields that are not first responder. Testing this is a bit | 214 // Ignore fields that are not first responder. Testing this is a bit |
215 // convoluted, since for NSTextFields with firstResponder status, the | 215 // convoluted, since for NSTextFields with firstResponder status, the |
216 // firstResponder is a subview of the NSTextField, not the field itself. | 216 // firstResponder is a subview of the NSTextField, not the field itself. |
217 NSView* firstResponderView = | 217 NSView* firstResponderView = |
218 base::mac::ObjCCast<NSView>([[field window] firstResponder]); | 218 base::mac::ObjCCast<NSView>([[field window] firstResponder]); |
219 if (![firstResponderView isDescendantOf:field]) | 219 if (![firstResponderView isDescendantOf:field]) |
220 return; | 220 return; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 | 264 |
265 selectedField = field; | 265 selectedField = field; |
266 selectedFieldOrigin = fieldOrigin; | 266 selectedFieldOrigin = fieldOrigin; |
267 } | 267 } |
268 | 268 |
269 return selectedField; | 269 return selectedField; |
270 } | 270 } |
271 | 271 |
272 @end | 272 @end |
OLD | NEW |