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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_details_container.mm

Issue 141813005: [rAC, OSX] Fix field alignment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« 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) 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 NSRect fieldRect = [field convertRect:[field bounds] toView:clipView]; 137 NSRect fieldRect = [field convertRect:[field bounds] toView:clipView];
138 138
139 // If the entire field is already visible, let's not scroll. 139 // If the entire field is already visible, let's not scroll.
140 NSRect documentRect = [clipView documentVisibleRect]; 140 NSRect documentRect = [clipView documentVisibleRect];
141 documentRect = [[clipView documentView] convertRect:documentRect 141 documentRect = [[clipView documentView] convertRect:documentRect
142 toView:clipView]; 142 toView:clipView];
143 if (NSContainsRect(documentRect, fieldRect)) 143 if (NSContainsRect(documentRect, fieldRect))
144 return; 144 return;
145 145
146 NSPoint scrollPoint = [clipView constrainScrollPoint: 146 NSPoint scrollPoint = [clipView constrainScrollPoint:
147 NSMakePoint(NSMinX(fieldRect), NSMinY(fieldRect) - bottomPadding)]; 147 NSMakePoint(0, NSMinY(fieldRect) - bottomPadding)];
148 [clipView scrollToPoint:scrollPoint]; 148 [clipView scrollToPoint:scrollPoint];
149 [scrollView_ reflectScrolledClipView:clipView]; 149 [scrollView_ reflectScrolledClipView:clipView];
150 [self updateErrorBubble]; 150 [self updateErrorBubble];
151 } 151 }
152 152
153 - (void)updateErrorBubble { 153 - (void)updateErrorBubble {
154 if (!delegate_->ShouldShowErrorBubble()) { 154 if (!delegate_->ShouldShowErrorBubble()) {
155 [errorBubbleController_ close]; 155 [errorBubbleController_ close];
156 } 156 }
157 } 157 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 selectedField = field; 282 selectedField = field;
283 selectedFieldOrigin = fieldOrigin; 283 selectedFieldOrigin = fieldOrigin;
284 } 284 }
285 285
286 return selectedField; 286 return selectedField;
287 } 287 }
288 288
289 @end 289 @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