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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 delegate_->StartSearch(); | 335 delegate_->StartSearch(); |
336 else | 336 else |
337 delegate_->StopSearch(); | 337 delegate_->StopSearch(); |
338 } | 338 } |
339 | 339 |
340 - (app_list::AppListModel*)appListModel { | 340 - (app_list::AppListModel*)appListModel { |
341 return [appsGridController_ model]; | 341 return [appsGridController_ model]; |
342 } | 342 } |
343 | 343 |
344 - (void)openResult:(app_list::SearchResult*)result { | 344 - (void)openResult:(app_list::SearchResult*)result { |
345 if (delegate_) | 345 if (delegate_) { |
346 delegate_->OpenSearchResult(result, 0 /* event flags */); | 346 delegate_->OpenSearchResult( |
| 347 result, false /* auto_launch */, 0 /* event flags */); |
| 348 } |
347 } | 349 } |
348 | 350 |
349 - (void)redoSearch { | 351 - (void)redoSearch { |
350 [self modelTextDidChange]; | 352 [self modelTextDidChange]; |
351 } | 353 } |
352 | 354 |
353 - (void)onProfilesChanged { | 355 - (void)onProfilesChanged { |
354 [appsSearchBoxController_ rebuildMenu]; | 356 [appsSearchBoxController_ rebuildMenu]; |
355 app_list::SigninDelegate* signinDelegate = | 357 app_list::SigninDelegate* signinDelegate = |
356 delegate_ ? delegate_->GetSigninDelegate() : NULL; | 358 delegate_ ? delegate_->GetSigninDelegate() : NULL; |
357 BOOL showSigninView = signinDelegate && signinDelegate->NeedSignin(); | 359 BOOL showSigninView = signinDelegate && signinDelegate->NeedSignin(); |
358 | 360 |
359 [[signinViewController_ view] removeFromSuperview]; | 361 [[signinViewController_ view] removeFromSuperview]; |
360 signinViewController_.reset(); | 362 signinViewController_.reset(); |
361 | 363 |
362 if (!showSigninView) { | 364 if (!showSigninView) { |
363 [backgroundView_ setHidden:NO]; | 365 [backgroundView_ setHidden:NO]; |
364 return; | 366 return; |
365 } | 367 } |
366 | 368 |
367 [backgroundView_ setHidden:YES]; | 369 [backgroundView_ setHidden:YES]; |
368 signinViewController_.reset( | 370 signinViewController_.reset( |
369 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] | 371 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] |
370 cornerRadius:kBubbleCornerRadius | 372 cornerRadius:kBubbleCornerRadius |
371 delegate:signinDelegate]); | 373 delegate:signinDelegate]); |
372 [[self view] addSubview:[signinViewController_ view]]; | 374 [[self view] addSubview:[signinViewController_ view]]; |
373 } | 375 } |
374 | 376 |
375 @end | 377 @end |
OLD | NEW |