Commit 54213ef5 authored by groby@chromium.org's avatar groby@chromium.org

[rAC, OSX] Fix loading screen layering issue.

The "loading..." shield on OSX had the currently focused UI element
"shine through" - i.e. the entire dialog was hidden behind it except
for the one focused element.

This change makes the loading screen first responder for the duration
of its visibility, preventing focus rings.

R=sail@chromium.org
BUG=none

Review URL: https://chromiumcodereview.appspot.com/23477044

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221862 0039d316-1c4b-4281-b951-d872f2087c98
parent 4f0d8d0a
......@@ -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];
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment