| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // Possibly handle grid navigation. | 327 // Possibly handle grid navigation. |
| 328 return [appsGridController_ handleCommandBySelector:command]; | 328 return [appsGridController_ handleCommandBySelector:command]; |
| 329 } | 329 } |
| 330 | 330 |
| 331 - (void)modelTextDidChange { | 331 - (void)modelTextDidChange { |
| 332 app_list::SearchBoxModel* searchBoxModel = [self searchBoxModel]; | 332 app_list::SearchBoxModel* searchBoxModel = [self searchBoxModel]; |
| 333 if (!searchBoxModel || !delegate_) | 333 if (!searchBoxModel || !delegate_) |
| 334 return; | 334 return; |
| 335 | 335 |
| 336 base::string16 query; | 336 base::string16 query; |
| 337 TrimWhitespace(searchBoxModel->text(), TRIM_ALL, &query); | 337 base::TrimWhitespace(searchBoxModel->text(), base::TRIM_ALL, &query); |
| 338 BOOL shouldShowSearch = !query.empty(); | 338 BOOL shouldShowSearch = !query.empty(); |
| 339 [self revealSearchResults:shouldShowSearch]; | 339 [self revealSearchResults:shouldShowSearch]; |
| 340 if (shouldShowSearch) | 340 if (shouldShowSearch) |
| 341 delegate_->StartSearch(); | 341 delegate_->StartSearch(); |
| 342 else | 342 else |
| 343 delegate_->StopSearch(); | 343 delegate_->StopSearch(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 - (app_list::AppListModel*)appListModel { | 346 - (app_list::AppListModel*)appListModel { |
| 347 return [appsGridController_ model]; | 347 return [appsGridController_ model]; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 374 | 374 |
| 375 [backgroundView_ setHidden:YES]; | 375 [backgroundView_ setHidden:YES]; |
| 376 signinViewController_.reset( | 376 signinViewController_.reset( |
| 377 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] | 377 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] |
| 378 cornerRadius:kBubbleCornerRadius | 378 cornerRadius:kBubbleCornerRadius |
| 379 delegate:signinDelegate]); | 379 delegate:signinDelegate]); |
| 380 [[self view] addSubview:[signinViewController_ view]]; | 380 [[self view] addSubview:[signinViewController_ view]]; |
| 381 } | 381 } |
| 382 | 382 |
| 383 @end | 383 @end |
| OLD | NEW |