OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ |
6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 void EmphasizeURLComponents() override; | 177 void EmphasizeURLComponents() override; |
178 | 178 |
179 // Apply our font and paragraph style to |attributedString|. | 179 // Apply our font and paragraph style to |attributedString|. |
180 void ApplyTextStyle(NSMutableAttributedString* attributedString); | 180 void ApplyTextStyle(NSMutableAttributedString* attributedString); |
181 | 181 |
182 // Calculates text attributes according to |display_text| and applies them | 182 // Calculates text attributes according to |display_text| and applies them |
183 // to the given |attributedString| object. | 183 // to the given |attributedString| object. |
184 void ApplyTextAttributes(const base::string16& display_text, | 184 void ApplyTextAttributes(const base::string16& display_text, |
185 NSMutableAttributedString* attributedString); | 185 NSMutableAttributedString* attributedString); |
186 | 186 |
187 // Update colors in |attributing_display_string_|. | |
Peter Kasting
2017/03/01 02:39:10
Nit: Descriptive, not imperative (e.g. "Updates");
elawrence
2017/03/01 21:49:01
Removed
| |
188 void SetEmphasis(bool emphasize, gfx::Range range) override; | |
189 | |
190 // Update color and font for scheme in |attributing_display_string_|. | |
191 void UpdateSchemeEmphasis(gfx::Range scheme_range) override; | |
192 | |
187 // Return the number of UTF-16 units in the current buffer, excluding the | 193 // Return the number of UTF-16 units in the current buffer, excluding the |
188 // suggested text. | 194 // suggested text. |
189 int GetOmniboxTextLength() const override; | 195 int GetOmniboxTextLength() const override; |
190 NSUInteger GetTextLength() const; | 196 NSUInteger GetTextLength() const; |
191 | 197 |
192 // Returns true if the caret is at the end of the content. | 198 // Returns true if the caret is at the end of the content. |
193 bool IsCaretAtEnd() const; | 199 bool IsCaretAtEnd() const; |
194 | 200 |
195 // Announce that an inline autocomplete is available for screenreaders. | 201 // Announce that an inline autocomplete is available for screenreaders. |
196 void AnnounceAutocompleteForScreenReader(const base::string16& text); | 202 void AnnounceAutocompleteForScreenReader(const base::string16& text); |
(...skipping 27 matching lines...) Expand all Loading... | |
224 bool do_coalesced_range_update_; | 230 bool do_coalesced_range_update_; |
225 NSRange coalesced_range_update_; | 231 NSRange coalesced_range_update_; |
226 | 232 |
227 // The time of the first character insert operation that has not yet been | 233 // The time of the first character insert operation that has not yet been |
228 // painted. Used to measure omnibox responsiveness with a histogram. | 234 // painted. Used to measure omnibox responsiveness with a histogram. |
229 base::TimeTicks insert_char_time_; | 235 base::TimeTicks insert_char_time_; |
230 | 236 |
231 // The time when OnBeforeDrawRect() was called. | 237 // The time when OnBeforeDrawRect() was called. |
232 base::TimeTicks draw_rect_start_time_; | 238 base::TimeTicks draw_rect_start_time_; |
233 | 239 |
240 // Temporary pointer to the attributed display string, stored as color and | |
241 // other emphasis attributes are applied by the superclass. | |
242 NSMutableAttributedString* attributing_display_string_; | |
Robert Sesek
2017/03/01 18:29:45
Who owns this? Either document as "Weak" or put in
elawrence
2017/03/01 21:49:01
Documented as weak.
| |
243 | |
234 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); | 244 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); |
235 }; | 245 }; |
236 | 246 |
237 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ | 247 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ |
OLD | NEW |