| 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/apps_search_box_controller.h" | 5 #import "ui/app_list/cocoa/apps_search_box_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 appListMenu_.reset(); | 169 appListMenu_.reset(); |
| 170 bridge_.reset(); // Ensure observers are cleared before updating |delegate_|. | 170 bridge_.reset(); // Ensure observers are cleared before updating |delegate_|. |
| 171 delegate_ = delegate; | 171 delegate_ = delegate; |
| 172 if (!delegate_) | 172 if (!delegate_) |
| 173 return; | 173 return; |
| 174 | 174 |
| 175 bridge_.reset(new app_list::SearchBoxModelObserverBridge(self)); | 175 bridge_.reset(new app_list::SearchBoxModelObserverBridge(self)); |
| 176 if (![delegate_ appListDelegate]) | 176 if (![delegate_ appListDelegate]) |
| 177 return; | 177 return; |
| 178 | 178 |
| 179 appListMenu_.reset(new app_list::AppListMenu([delegate_ appListDelegate])); | 179 appListMenu_.reset( |
| 180 new app_list::AppListMenu([delegate_ appListDelegate], |
| 181 [delegate_ appListModel]->users())); |
| 180 [self rebuildMenu]; | 182 [self rebuildMenu]; |
| 181 } | 183 } |
| 182 | 184 |
| 183 - (NSTextField*)searchTextField { | 185 - (NSTextField*)searchTextField { |
| 184 return searchTextField_; | 186 return searchTextField_; |
| 185 } | 187 } |
| 186 | 188 |
| 187 - (NSPopUpButton*)menuControl { | 189 - (NSPopUpButton*)menuControl { |
| 188 return menuButton_; | 190 return menuButton_; |
| 189 } | 191 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 NSPoint anchorPoint = [[menuButton window] convertBaseToScreen:NSMakePoint( | 398 NSPoint anchorPoint = [[menuButton window] convertBaseToScreen:NSMakePoint( |
| 397 NSMaxX(anchorRect) + kMenuXOffsetFromButton, | 399 NSMaxX(anchorRect) + kMenuXOffsetFromButton, |
| 398 NSMinY(anchorRect) - kMenuYOffsetFromButton)]; | 400 NSMinY(anchorRect) - kMenuYOffsetFromButton)]; |
| 399 NSRect confinementRect = [[menuButton window] frame]; | 401 NSRect confinementRect = [[menuButton window] frame]; |
| 400 confinementRect.size = NSMakeSize(anchorPoint.x - NSMinX(confinementRect), | 402 confinementRect.size = NSMakeSize(anchorPoint.x - NSMinX(confinementRect), |
| 401 anchorPoint.y - NSMinY(confinementRect)); | 403 anchorPoint.y - NSMinY(confinementRect)); |
| 402 return confinementRect; | 404 return confinementRect; |
| 403 } | 405 } |
| 404 | 406 |
| 405 @end | 407 @end |
| OLD | NEW |