| 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/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "skia/ext/skia_utils_mac.h" | 9 #include "skia/ext/skia_utils_mac.h" |
| 10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 - (NSInteger)pagerSegmentAtLocation:(NSPoint)locationInWindow { | 218 - (NSInteger)pagerSegmentAtLocation:(NSPoint)locationInWindow { |
| 219 return [pagerControl_ findAndHighlightSegmentAtLocation:locationInWindow]; | 219 return [pagerControl_ findAndHighlightSegmentAtLocation:locationInWindow]; |
| 220 } | 220 } |
| 221 | 221 |
| 222 - (app_list::SearchBoxModel*)searchBoxModel { | 222 - (app_list::SearchBoxModel*)searchBoxModel { |
| 223 app_list::AppListModel* appListModel = [appsGridController_ model]; | 223 app_list::AppListModel* appListModel = [appsGridController_ model]; |
| 224 return appListModel ? appListModel->search_box() : NULL; | 224 return appListModel ? appListModel->search_box() : NULL; |
| 225 } | 225 } |
| 226 | 226 |
| 227 - (app_list::AppListViewDelegate*)appListDelegate { |
| 228 return [self delegate]; |
| 229 } |
| 230 |
| 227 - (BOOL)control:(NSControl*)control | 231 - (BOOL)control:(NSControl*)control |
| 228 textView:(NSTextView*)textView | 232 textView:(NSTextView*)textView |
| 229 doCommandBySelector:(SEL)command { | 233 doCommandBySelector:(SEL)command { |
| 230 if (showingSearchResults_) | 234 if (showingSearchResults_) |
| 231 return [appsSearchResultsController_ handleCommandBySelector:command]; | 235 return [appsSearchResultsController_ handleCommandBySelector:command]; |
| 232 | 236 |
| 233 // If anything has been written, let the search view handle it. | 237 // If anything has been written, let the search view handle it. |
| 234 if ([[control stringValue] length] > 0) | 238 if ([[control stringValue] length] > 0) |
| 235 return NO; | 239 return NO; |
| 236 | 240 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 267 } | 271 } |
| 268 | 272 |
| 269 - (void)openResult:(app_list::SearchResult*)result { | 273 - (void)openResult:(app_list::SearchResult*)result { |
| 270 if (delegate_) | 274 if (delegate_) |
| 271 delegate_->OpenSearchResult(result, 0 /* event flags */); | 275 delegate_->OpenSearchResult(result, 0 /* event flags */); |
| 272 | 276 |
| 273 [appsSearchBoxController_ clearSearch]; | 277 [appsSearchBoxController_ clearSearch]; |
| 274 } | 278 } |
| 275 | 279 |
| 276 @end | 280 @end |
| OLD | NEW |