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/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
11 #include "skia/ext/skia_utils_mac.h" | 11 #include "skia/ext/skia_utils_mac.h" |
12 #include "ui/app_list/app_list_constants.h" | 12 #include "ui/app_list/app_list_constants.h" |
13 #include "ui/app_list/app_list_model.h" | 13 #include "ui/app_list/app_list_model.h" |
14 #include "ui/app_list/app_list_view_delegate.h" | 14 #include "ui/app_list/app_list_view_delegate.h" |
15 #include "ui/app_list/app_list_view_delegate_observer.h" | 15 #include "ui/app_list/app_list_view_delegate_observer.h" |
16 #include "ui/app_list/signin_delegate.h" | |
17 #import "ui/app_list/cocoa/app_list_pager_view.h" | 16 #import "ui/app_list/cocoa/app_list_pager_view.h" |
18 #import "ui/app_list/cocoa/apps_grid_controller.h" | 17 #import "ui/app_list/cocoa/apps_grid_controller.h" |
19 #import "ui/app_list/cocoa/signin_view_controller.h" | |
20 #import "ui/base/cocoa/flipped_view.h" | 18 #import "ui/base/cocoa/flipped_view.h" |
21 #include "ui/app_list/search_box_model.h" | 19 #include "ui/app_list/search_box_model.h" |
22 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" | 20 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" |
23 | 21 |
24 namespace { | 22 namespace { |
25 | 23 |
26 // The roundedness of the corners of the bubble. | 24 // The roundedness of the corners of the bubble. |
27 const CGFloat kBubbleCornerRadius = 3; | 25 const CGFloat kBubbleCornerRadius = 3; |
28 | 26 |
29 // Height of the pager. | 27 // Height of the pager. |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 result, false /* auto_launch */, 0 /* event flags */); | 355 result, false /* auto_launch */, 0 /* event flags */); |
358 } | 356 } |
359 } | 357 } |
360 | 358 |
361 - (void)redoSearch { | 359 - (void)redoSearch { |
362 [self modelTextDidChange]; | 360 [self modelTextDidChange]; |
363 } | 361 } |
364 | 362 |
365 - (void)onProfilesChanged { | 363 - (void)onProfilesChanged { |
366 [appsSearchBoxController_ rebuildMenu]; | 364 [appsSearchBoxController_ rebuildMenu]; |
367 app_list::SigninDelegate* signinDelegate = | |
368 delegate_ ? delegate_->GetSigninDelegate() : NULL; | |
369 BOOL showSigninView = signinDelegate && signinDelegate->NeedSignin(); | |
370 | |
371 [[signinViewController_ view] removeFromSuperview]; | |
372 signinViewController_.reset(); | |
373 | |
374 if (!showSigninView) { | |
375 [backgroundView_ setHidden:NO]; | |
376 return; | |
377 } | |
378 | |
379 [backgroundView_ setHidden:YES]; | |
380 signinViewController_.reset( | |
381 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] | |
382 cornerRadius:kBubbleCornerRadius | |
383 delegate:signinDelegate]); | |
384 [[self view] addSubview:[signinViewController_ view]]; | |
385 } | 365 } |
386 | 366 |
387 @end | 367 @end |
OLD | NEW |