| 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 "skia/ext/skia_utils_mac.h" | 8 #include "skia/ext/skia_utils_mac.h" |
| 9 #include "ui/app_list/app_list_constants.h" | 9 #include "ui/app_list/app_list_constants.h" |
| 10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 - (NSInteger)pagerSegmentAtLocation:(NSPoint)locationInWindow { | 198 - (NSInteger)pagerSegmentAtLocation:(NSPoint)locationInWindow { |
| 199 return [pagerControl_ findAndHighlightSegmentAtLocation:locationInWindow]; | 199 return [pagerControl_ findAndHighlightSegmentAtLocation:locationInWindow]; |
| 200 } | 200 } |
| 201 | 201 |
| 202 - (app_list::SearchBoxModel*)searchBoxModel { | 202 - (app_list::SearchBoxModel*)searchBoxModel { |
| 203 app_list::AppListModel* appListModel = [appsGridController_ model]; | 203 app_list::AppListModel* appListModel = [appsGridController_ model]; |
| 204 return appListModel ? appListModel->search_box() : NULL; | 204 return appListModel ? appListModel->search_box() : NULL; |
| 205 } | 205 } |
| 206 | 206 |
| 207 - (app_list::AppListViewDelegate*)appListDelegate { |
| 208 return [self delegate]; |
| 209 } |
| 210 |
| 207 - (BOOL)control:(NSControl*)control | 211 - (BOOL)control:(NSControl*)control |
| 208 textView:(NSTextView*)textView | 212 textView:(NSTextView*)textView |
| 209 doCommandBySelector:(SEL)command { | 213 doCommandBySelector:(SEL)command { |
| 210 // TODO(tapted): If showing search results, first pass up/down navigation to | 214 // TODO(tapted): If showing search results, first pass up/down navigation to |
| 211 // the search results controller. | 215 // the search results controller. |
| 212 | 216 |
| 213 // If anything has been written, let the search view handle it. | 217 // If anything has been written, let the search view handle it. |
| 214 if ([[control stringValue] length] > 0) | 218 if ([[control stringValue] length] > 0) |
| 215 return NO; | 219 return NO; |
| 216 | 220 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 231 app_list::SearchBoxModel* searchBoxModel = [self searchBoxModel]; | 235 app_list::SearchBoxModel* searchBoxModel = [self searchBoxModel]; |
| 232 if (!searchBoxModel || !delegate_) | 236 if (!searchBoxModel || !delegate_) |
| 233 return; | 237 return; |
| 234 | 238 |
| 235 // TODO(tapted): If there is a non-empty query in |searchBoxModel| reveal the | 239 // TODO(tapted): If there is a non-empty query in |searchBoxModel| reveal the |
| 236 // search results, and run delegate_->StartSearch(). Or, if the query is now | 240 // search results, and run delegate_->StartSearch(). Or, if the query is now |
| 237 // empty, hide results, and run delegate_->StopSearch(). | 241 // empty, hide results, and run delegate_->StopSearch(). |
| 238 } | 242 } |
| 239 | 243 |
| 240 @end | 244 @end |
| OLD | NEW |