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

Unified Diff: ui/app_list/cocoa/app_list_view_controller.mm

Issue 117683002: Show the Mac app launcher window with a spinner while loading Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, ensure no startup flows regress Created 6 years, 11 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
Index: ui/app_list/cocoa/app_list_view_controller.mm
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index ad73540f6e9b4b501e00773ad7e603dc98c11950..a28171cd7e3ef41f0e1d73997a171342b2241a9c 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -160,6 +160,10 @@ void AppListModelObserverBridge::OnProfilesChanged() {
- (void)setDelegate:(scoped_ptr<app_list::AppListViewDelegate>)newDelegate {
if (delegate_) {
+ // Ensure the search box is cleared when switching profiles.
+ if ([self searchBoxModel])
+ [self searchBoxModel]->SetText(base::string16());
+
// First clean up, in reverse order.
app_list_model_observer_bridge_.reset();
[appsSearchResultsController_ setDelegate:nil];
@@ -167,8 +171,13 @@ void AppListModelObserverBridge::OnProfilesChanged() {
[appsGridController_ setDelegate:nil];
}
delegate_.reset(newDelegate.release());
- if (!delegate_)
+ if (delegate_) {
+ [loadingIndicator_ stopAnimation:self];
+ } else {
+ [loadingIndicator_ startAnimation:self];
return;
+ }
+
[appsGridController_ setDelegate:delegate_.get()];
[appsSearchBoxController_ setDelegate:self];
[appsSearchResultsController_ setDelegate:self];
@@ -200,8 +209,20 @@ void AppListModelObserverBridge::OnProfilesChanged() {
base::scoped_nsobject<NSView> containerView(
[[NSView alloc] initWithFrame:[backgroundView_ frame]]);
+ loadingIndicator_.reset(
+ [[NSProgressIndicator alloc] initWithFrame:NSZeroRect]);
+ [loadingIndicator_ setStyle:NSProgressIndicatorSpinningStyle];
+ [loadingIndicator_ sizeToFit];
+ NSRect indicatorRect = [loadingIndicator_ frame];
+ indicatorRect.origin.x = NSWidth(contentsRect) / 2 - NSMidX(indicatorRect);
+ indicatorRect.origin.y = NSHeight(contentsRect) / 2 - NSMidY(indicatorRect);
+ [loadingIndicator_ setFrame:indicatorRect];
+ [loadingIndicator_ setDisplayedWhenStopped:NO];
+ [loadingIndicator_ startAnimation:self];
+
[contentsView_ addSubview:[appsGridController_ view]];
[contentsView_ addSubview:pagerControl_];
+ [contentsView_ addSubview:loadingIndicator_];
[backgroundView_ addSubview:contentsView_];
[backgroundView_ addSubview:[appsSearchResultsController_ view]];
[backgroundView_ addSubview:[appsSearchBoxController_ view]];
« ui/app_list/cocoa/app_list_view_controller.h ('K') | « ui/app_list/cocoa/app_list_view_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698