OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 static NSMutableAttributedString* ElideString( | 99 static NSMutableAttributedString* ElideString( |
100 NSMutableAttributedString* aString, | 100 NSMutableAttributedString* aString, |
101 const std::wstring originalString, | 101 const std::wstring originalString, |
102 const gfx::Font& font, | 102 const gfx::Font& font, |
103 const float cellWidth); | 103 const float cellWidth); |
104 | 104 |
105 private: | 105 private: |
106 // Create the popup_ instance if needed. | 106 // Create the popup_ instance if needed. |
107 void CreatePopupIfNeeded(); | 107 void CreatePopupIfNeeded(); |
108 | 108 |
| 109 // Sets the popup frame, animating to the new frame if the popup is shrinking, |
| 110 // setting the frame immediately otherwise. Does nothing if the popup is |
| 111 // already animating to the given frame. |
| 112 void SetPopupFrame(const NSRect frame); |
| 113 |
109 scoped_ptr<AutocompletePopupModel> model_; | 114 scoped_ptr<AutocompletePopupModel> model_; |
110 AutocompleteEditViewMac* edit_view_; | 115 AutocompleteEditViewMac* edit_view_; |
111 NSTextField* field_; // owned by tab controller | 116 NSTextField* field_; // owned by tab controller |
112 | 117 |
113 // Child window containing a matrix which implements the popup. | 118 // Child window containing a matrix which implements the popup. |
114 scoped_nsobject<NSWindow> popup_; | 119 scoped_nsobject<NSWindow> popup_; |
| 120 NSRect targetPopupFrame_; |
115 | 121 |
116 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewMac); | 122 DISALLOW_COPY_AND_ASSIGN(AutocompletePopupViewMac); |
117 }; | 123 }; |
118 | 124 |
119 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ | 125 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_POPUP_VIEW_MAC_H_ |
OLD | NEW |