Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h

Issue 2126023003: Mac (Cocoa) Omnibox: Force text field to LTR context if it is a URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698