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

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

Issue 920243002: Mac: Fix omnibox hint text is 1px lower than typed text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dragging-window-drawing
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 // Update the field with |display_text| and set the selection. 148 // Update the field with |display_text| and set the selection.
149 void SetTextAndSelectedRange(const base::string16& display_text, 149 void SetTextAndSelectedRange(const base::string16& display_text,
150 const NSRange range); 150 const NSRange range);
151 151
152 // Pass the current content of |field_| to SetText(), maintaining 152 // Pass the current content of |field_| to SetText(), maintaining
153 // any selection. Named to be consistent with GTK and Windows, 153 // any selection. Named to be consistent with GTK and Windows,
154 // though here we cannot really do the in-place operation they do. 154 // though here we cannot really do the in-place operation they do.
155 void EmphasizeURLComponents() override; 155 void EmphasizeURLComponents() override;
156 156
157 // Apply our font and paragraph style to |as|.
158 void ApplyTextStyle(NSMutableAttributedString* as);
159
157 // Calculates text attributes according to |display_text| and applies them 160 // Calculates text attributes according to |display_text| and applies them
158 // to the given |as| object. 161 // to the given |as| object.
159 void ApplyTextAttributes(const base::string16& display_text, 162 void ApplyTextAttributes(const base::string16& display_text,
160 NSMutableAttributedString* as); 163 NSMutableAttributedString* as);
161 164
162 // Return the number of UTF-16 units in the current buffer, excluding the 165 // Return the number of UTF-16 units in the current buffer, excluding the
163 // suggested text. 166 // suggested text.
164 int GetOmniboxTextLength() const override; 167 int GetOmniboxTextLength() const override;
165 NSUInteger GetTextLength() const; 168 NSUInteger GetTextLength() const;
166 169
(...skipping 27 matching lines...) Expand all
194 bool in_coalesced_update_block_; 197 bool in_coalesced_update_block_;
195 bool do_coalesced_text_update_; 198 bool do_coalesced_text_update_;
196 base::string16 coalesced_text_update_; 199 base::string16 coalesced_text_update_;
197 bool do_coalesced_range_update_; 200 bool do_coalesced_range_update_;
198 NSRange coalesced_range_update_; 201 NSRange coalesced_range_update_;
199 202
200 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); 203 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac);
201 }; 204 };
202 205
203 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 206 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698