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 | 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 Loading... |
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 Loading... |
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_ |
OLD | NEW |