Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions IdentityCore/src/MSIDConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ extern NSString * _Nonnull const MSID_FLIGHT_DISABLE_REMOVE_ACCOUNT_ARTIFACTS;
extern NSString * _Nonnull const MSID_FLIGHT_ENABLE_QUERYING_STK;
extern NSString * _Nonnull const MSID_FLIGHT_IS_BART_SUPPORTED;

extern NSString * _Nonnull const MSID_FLIGHT_USE_AUTOLAYOUT_FOR_LOADING_INDICATOR;

extern NSString * _Nonnull const MSID_DOMAIN_HINT_KEY;

extern NSString * _Nonnull const MSID_FLIGHT_ENABLE_THREAD_STARVATION;
Expand Down
2 changes: 2 additions & 0 deletions IdentityCore/src/MSIDConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
NSString *const MSID_FLIGHT_ENABLE_QUERYING_STK = @"enable_querying_stk";
NSString *const MSID_FLIGHT_IS_BART_SUPPORTED = @"is_msal_bart_supported";

NSString *const MSID_FLIGHT_USE_AUTOLAYOUT_FOR_LOADING_INDICATOR = @"use_autolayout_for_loading_indicator";

NSString *const MSID_DOMAIN_HINT_KEY = @"domain_hint";

// This is SsoExt flow only flight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
// THE SOFTWARE.

#import "MSIDWebviewUIController.h"
#import "MSIDFlightManager.h"
#import "MSIDConstants.h"

#if !MSID_EXCLUDE_WEBKIT

#define DEFAULT_WINDOW_WIDTH 420
#define DEFAULT_WINDOW_HEIGHT 650

NSInteger const MSID_LOADING_INDICATOR_SIZE = 32;

static WKWebViewConfiguration *s_webConfig;

@interface MSIDWebviewUIController ( ) <NSWindowDelegate>
Expand Down Expand Up @@ -94,6 +98,18 @@ - (BOOL)loadView:(__unused NSError *__autoreleasing*)error
{
_loadingIndicator = [self prepareLoadingIndicator];
[_webView addSubview:_loadingIndicator];

BOOL useAutolayout = [MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_USE_AUTOLAYOUT_FOR_LOADING_INDICATOR];
if (useAutolayout)
{
_loadingIndicator.translatesAutoresizingMaskIntoConstraints = NO;
[NSLayoutConstraint activateConstraints:@[
[_loadingIndicator.centerXAnchor constraintEqualToAnchor:_webView.centerXAnchor],
[_loadingIndicator.centerYAnchor constraintEqualToAnchor:_webView.centerYAnchor],
[_loadingIndicator.widthAnchor constraintEqualToConstant:MSID_LOADING_INDICATOR_SIZE],
[_loadingIndicator.heightAnchor constraintEqualToConstant:MSID_LOADING_INDICATOR_SIZE]
]];
}
return YES;
}

Expand Down Expand Up @@ -223,8 +239,8 @@ - (NSProgressIndicator *)prepareLoadingIndicator
windowWidth = window.size.width;
windowHeight = window.size.height;
}

NSProgressIndicator *loadingIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(windowWidth / 2 - 16, windowHeight / 2 - 16, 32, 32)];
NSProgressIndicator *loadingIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(windowWidth / 2 - MSID_LOADING_INDICATOR_SIZE / 2, windowHeight / 2 - MSID_LOADING_INDICATOR_SIZE / 2, MSID_LOADING_INDICATOR_SIZE, MSID_LOADING_INDICATOR_SIZE)];
[loadingIndicator setStyle:NSProgressIndicatorStyleSpinning];
// Keep the item centered in the window even if it's resized.
[loadingIndicator setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin];
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Version TBD
* Silent token request should use FRT first when single FRT is enabled (#1624)
* Use autolayout for loading indicator #1628

Version 1.17.0
* Add flag to indicate app is requesting broker for Bound app RT #1578
Expand Down
Loading