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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Update the field with |display_text| and set the selection. | 175 // Update the field with |display_text| and set the selection. |
176 void SetTextAndSelectedRange(const base::string16& display_text, | 176 void SetTextAndSelectedRange(const base::string16& display_text, |
177 const NSRange range); | 177 const NSRange range); |
178 | 178 |
179 // Pass the current content of |field_| to SetText(), maintaining | 179 // Pass the current content of |field_| to SetText(), maintaining |
180 // any selection. Named to be consistent with GTK and Windows, | 180 // any selection. Named to be consistent with GTK and Windows, |
181 // though here we cannot really do the in-place operation they do. | 181 // though here we cannot really do the in-place operation they do. |
182 void EmphasizeURLComponents() override; | 182 void EmphasizeURLComponents() override; |
183 | 183 |
184 // Apply our font and paragraph style to |attributedString|. | 184 // Apply our font and paragraph style to |attributedString|. |
185 void ApplyTextStyle(NSMutableAttributedString* attributedString); | 185 // If |force_ltr|, sets the paragraph direction to left-to-right. |
| 186 void ApplyTextStyle(bool force_ltr, |
| 187 NSMutableAttributedString* attributedString); |
186 | 188 |
187 // Calculates text attributes according to |display_text| and applies them | 189 // Calculates text attributes according to |display_text| and applies them |
188 // to the given |attributedString| object. | 190 // to the given |attributedString| object. |
189 void ApplyTextAttributes(const base::string16& display_text, | 191 void ApplyTextAttributes(const base::string16& display_text, |
190 NSMutableAttributedString* attributedString); | 192 NSMutableAttributedString* attributedString); |
191 | 193 |
192 // Return the number of UTF-16 units in the current buffer, excluding the | 194 // Return the number of UTF-16 units in the current buffer, excluding the |
193 // suggested text. | 195 // suggested text. |
194 int GetOmniboxTextLength() const override; | 196 int GetOmniboxTextLength() const override; |
195 NSUInteger GetTextLength() const; | 197 NSUInteger GetTextLength() const; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 NSRange coalesced_range_update_; | 234 NSRange coalesced_range_update_; |
233 | 235 |
234 // The time of the first character insert operation that has not yet been | 236 // The time of the first character insert operation that has not yet been |
235 // painted. Used to measure omnibox responsiveness with a histogram. | 237 // painted. Used to measure omnibox responsiveness with a histogram. |
236 base::TimeTicks insert_char_time_; | 238 base::TimeTicks insert_char_time_; |
237 | 239 |
238 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); | 240 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); |
239 }; | 241 }; |
240 | 242 |
241 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ | 243 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ |
OLD | NEW |