| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 - (void)dealloc { | 128 - (void)dealloc { |
| 129 // Ensure that setDelegate(NULL) has been called before destruction, because | 129 // Ensure that setDelegate(NULL) has been called before destruction, because |
| 130 // dealloc can be called at odd times, and Objective C destruction order does | 130 // dealloc can be called at odd times, and Objective C destruction order does |
| 131 // not properly tear down these dependencies. | 131 // not properly tear down these dependencies. |
| 132 DCHECK(delegate_ == NULL); | 132 DCHECK(delegate_ == NULL); |
| 133 [appsGridController_ setPaginationObserver:nil]; | 133 [appsGridController_ setPaginationObserver:nil]; |
| 134 [super dealloc]; | 134 [super dealloc]; |
| 135 } | 135 } |
| 136 | 136 |
| 137 - (AppsSearchBoxController*)searchBoxController { |
| 138 return appsSearchBoxController_; |
| 139 } |
| 140 |
| 141 - (BOOL)showingSearchResults { |
| 142 return showingSearchResults_; |
| 143 } |
| 144 |
| 137 - (AppsGridController*)appsGridController { | 145 - (AppsGridController*)appsGridController { |
| 138 return appsGridController_; | 146 return appsGridController_; |
| 139 } | 147 } |
| 140 | 148 |
| 141 - (NSSegmentedControl*)pagerControl { | 149 - (NSSegmentedControl*)pagerControl { |
| 142 return pagerControl_; | 150 return pagerControl_; |
| 143 } | 151 } |
| 144 | 152 |
| 145 - (NSView*)backgroundView { | 153 - (NSView*)backgroundView { |
| 146 return backgroundView_; | 154 return backgroundView_; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 delegate_->StopSearch(); | 316 delegate_->StopSearch(); |
| 309 } | 317 } |
| 310 | 318 |
| 311 - (app_list::AppListModel*)appListModel { | 319 - (app_list::AppListModel*)appListModel { |
| 312 return [appsGridController_ model]; | 320 return [appsGridController_ model]; |
| 313 } | 321 } |
| 314 | 322 |
| 315 - (void)openResult:(app_list::SearchResult*)result { | 323 - (void)openResult:(app_list::SearchResult*)result { |
| 316 if (delegate_) | 324 if (delegate_) |
| 317 delegate_->OpenSearchResult(result, 0 /* event flags */); | 325 delegate_->OpenSearchResult(result, 0 /* event flags */); |
| 318 | |
| 319 [appsSearchBoxController_ clearSearch]; | |
| 320 } | 326 } |
| 321 | 327 |
| 322 - (void)redoSearch { | 328 - (void)redoSearch { |
| 323 [self modelTextDidChange]; | 329 [self modelTextDidChange]; |
| 324 } | 330 } |
| 325 | 331 |
| 326 - (void)onSigninStatusChanged { | 332 - (void)onSigninStatusChanged { |
| 327 [appsSearchBoxController_ rebuildMenu]; | 333 [appsSearchBoxController_ rebuildMenu]; |
| 328 app_list::SigninDelegate* signinDelegate = | 334 app_list::SigninDelegate* signinDelegate = |
| 329 delegate_ ? delegate_->GetSigninDelegate() : NULL; | 335 delegate_ ? delegate_->GetSigninDelegate() : NULL; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 340 | 346 |
| 341 [backgroundView_ setHidden:YES]; | 347 [backgroundView_ setHidden:YES]; |
| 342 signinViewController_.reset( | 348 signinViewController_.reset( |
| 343 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] | 349 [[SigninViewController alloc] initWithFrame:[backgroundView_ frame] |
| 344 cornerRadius:kBubbleCornerRadius | 350 cornerRadius:kBubbleCornerRadius |
| 345 delegate:signinDelegate]); | 351 delegate:signinDelegate]); |
| 346 [[self view] addSubview:[signinViewController_ view]]; | 352 [[self view] addSubview:[signinViewController_ view]]; |
| 347 } | 353 } |
| 348 | 354 |
| 349 @end | 355 @end |
| OLD | NEW |