OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ui/app_list/cocoa/app_list_view_controller.h" | 5 #import "ui/app_list/cocoa/app_list_view_controller.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "skia/ext/skia_utils_mac.h" | 10 #include "skia/ext/skia_utils_mac.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 - (void)redoSearch { | 332 - (void)redoSearch { |
333 [self modelTextDidChange]; | 333 [self modelTextDidChange]; |
334 } | 334 } |
335 | 335 |
336 - (void)onSigninStatusChanged { | 336 - (void)onSigninStatusChanged { |
337 [appsSearchBoxController_ rebuildMenu]; | 337 [appsSearchBoxController_ rebuildMenu]; |
338 app_list::SigninDelegate* signinDelegate = | 338 app_list::SigninDelegate* signinDelegate = |
339 delegate_ ? delegate_->GetSigninDelegate() : NULL; | 339 delegate_ ? delegate_->GetSigninDelegate() : NULL; |
340 BOOL show_signin_view = | 340 BOOL show_signin_view = |
341 signinDelegate && ![appsGridController_ model]->signed_in(); | 341 signinDelegate && ![appsGridController_ model]->signed_in(); |
342 if (!!signinViewController_ == show_signin_view) | 342 |
343 return; | 343 [[signinViewController_ view] removeFromSuperview]; |
| 344 signinViewController_.reset(); |
344 | 345 |
345 if (!show_signin_view) { | 346 if (!show_signin_view) { |
346 [[signinViewController_ view] removeFromSuperview]; | |
347 signinViewController_.reset(); | |
348 [backgroundView_ setHidden:NO]; | 347 [backgroundView_ setHidden:NO]; |
349 return; | 348 return; |
350 } | 349 } |
351 | 350 |
352 [backgroundView_ setHidden:YES]; | 351 [backgroundView_ setHidden:YES]; |
353 signinViewController_.reset( | 352 signinViewController_.reset( |
354 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] | 353 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] |
355 cornerRadius:kBubbleCornerRadius | 354 cornerRadius:kBubbleCornerRadius |
356 delegate:signinDelegate]); | 355 delegate:signinDelegate]); |
357 [[self view] addSubview:[signinViewController_ view]]; | 356 [[self view] addSubview:[signinViewController_ view]]; |
358 } | 357 } |
359 | 358 |
360 @end | 359 @end |
OLD | NEW |