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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 void SearchBoxModelObserverBridge::SelectionModelChanged() { | 104 void SearchBoxModelObserverBridge::SelectionModelChanged() { |
105 // TODO(tapted): See if anything needs to be done here for RTL. | 105 // TODO(tapted): See if anything needs to be done here for RTL. |
106 } | 106 } |
107 | 107 |
108 void SearchBoxModelObserverBridge::TextChanged() { | 108 void SearchBoxModelObserverBridge::TextChanged() { |
109 // Currently the model text is only changed when we are not observing it, or | 109 // Currently the model text is only changed when we are not observing it, or |
110 // it is changed in tests to establish a particular state. | 110 // it is changed in tests to establish a particular state. |
111 [[parent_ searchTextField] | 111 [[parent_ searchTextField] |
112 setStringValue:base::SysUTF16ToNSString(GetModel()->text())]; | 112 setStringValue:base::SysUTF16ToNSString(GetModel()->text())]; |
| 113 [[parent_ delegate] modelTextDidChange]; |
113 } | 114 } |
114 | 115 |
115 } // namespace app_list | 116 } // namespace app_list |
116 | 117 |
117 @interface SearchTextField : NSTextField { | 118 @interface SearchTextField : NSTextField { |
118 @private | 119 @private |
119 NSRect textFrameInset_; | 120 NSRect textFrameInset_; |
120 } | 121 } |
121 | 122 |
122 @property(readonly, nonatomic) NSRect textFrameInset; | 123 @property(readonly, nonatomic) NSRect textFrameInset; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 NSPoint anchorPoint = [[menuButton window] convertBaseToScreen:NSMakePoint( | 397 NSPoint anchorPoint = [[menuButton window] convertBaseToScreen:NSMakePoint( |
397 NSMaxX(anchorRect) + kMenuXOffsetFromButton, | 398 NSMaxX(anchorRect) + kMenuXOffsetFromButton, |
398 NSMinY(anchorRect) - kMenuYOffsetFromButton)]; | 399 NSMinY(anchorRect) - kMenuYOffsetFromButton)]; |
399 NSRect confinementRect = [[menuButton window] frame]; | 400 NSRect confinementRect = [[menuButton window] frame]; |
400 confinementRect.size = NSMakeSize(anchorPoint.x - NSMinX(confinementRect), | 401 confinementRect.size = NSMakeSize(anchorPoint.x - NSMinX(confinementRect), |
401 anchorPoint.y - NSMinY(confinementRect)); | 402 anchorPoint.y - NSMinY(confinementRect)); |
402 return confinementRect; | 403 return confinementRect; |
403 } | 404 } |
404 | 405 |
405 @end | 406 @end |
OLD | NEW |