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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm

Issue 23477044: [rAC, OSX] Fix loading screen layering issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now with grammatically correct comments, too. Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
index 16667185ed9df092d7e4fca05fd2189570efb9ba..af3a6287105dd06a65f7a6a2126e2d0d36f32297 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
@@ -453,17 +453,27 @@ void AutofillDialogCocoa::OnConstrainedWindowClosed(
- (void)updateAccountChooser {
[accountChooser_ update];
[mainContainer_ updateLegalDocuments];
- // TODO(estade): replace this with a better loading image/animation.
- // See http://crbug.com/230932
+
NSString* newLoadingMessage = @"";
if (autofillDialog_->delegate()->ShouldShowSpinner())
newLoadingMessage = l10n_util::GetNSStringWithFixup(IDS_TAB_LOADING_TITLE);
if (![newLoadingMessage isEqualToString:
[loadingShieldTextField_ stringValue]]) {
+ NSView* loadingShieldView = [loadingShieldTextField_ superview];
[loadingShieldTextField_ setStringValue:newLoadingMessage];
[loadingShieldTextField_ sizeToFit];
- [[loadingShieldTextField_ superview] setHidden:
- [newLoadingMessage length] == 0];
+ [loadingShieldView setHidden:[newLoadingMessage length] == 0];
+
+ // For the duration of the loading shield, it becomes first responder.
+ // This prevents the currently focused text field "shining through".
+ if (![loadingShieldView isHidden]) {
+ [loadingShieldView setNextResponder:
+ [[loadingShieldView window] firstResponder]];
+ [[loadingShieldView window] makeFirstResponder:loadingShieldView];
+ } else {
+ [[loadingShieldView window] makeFirstResponder:
+ [loadingShieldView nextResponder]];
+ }
[self requestRelayout];
}
}
« 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