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

Side by Side Diff: ui/gfx/break_list.h

Issue 16867016: Windows implementation of multiline RenderText (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comments addressed Created 7 years, 4 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 | ui/gfx/render_text.h » ('j') | ui/gfx/render_text.h » ('J')
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 UI_GFX_BREAK_LIST_H_ 5 #ifndef UI_GFX_BREAK_LIST_H_
6 #define UI_GFX_BREAK_LIST_H_ 6 #define UI_GFX_BREAK_LIST_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 18 matching lines...) Expand all
29 // The break type and const iterator, typedef'ed for convenience. 29 // The break type and const iterator, typedef'ed for convenience.
30 typedef std::pair<size_t, T> Break; 30 typedef std::pair<size_t, T> Break;
31 typedef typename std::vector<Break>::const_iterator const_iterator; 31 typedef typename std::vector<Break>::const_iterator const_iterator;
32 32
33 // Initialize a break at position 0 with the default or supplied |value|. 33 // Initialize a break at position 0 with the default or supplied |value|.
34 BreakList(); 34 BreakList();
35 explicit BreakList(T value); 35 explicit BreakList(T value);
36 36
37 const std::vector<Break>& breaks() const { return breaks_; } 37 const std::vector<Break>& breaks() const { return breaks_; }
38 38
39 size_t max() const { return max_; }
40
39 // Clear the breaks and set a break at position 0 with the supplied |value|. 41 // Clear the breaks and set a break at position 0 with the supplied |value|.
40 void SetValue(T value); 42 void SetValue(T value);
41 43
42 // Adjust the breaks to apply |value| over the supplied |range|. 44 // Adjust the breaks to apply |value| over the supplied |range|.
43 void ApplyValue(T value, const ui::Range& range); 45 void ApplyValue(T value, const ui::Range& range);
44 46
45 // Set the max position and trim any breaks at or beyond that position. 47 // Set the max position and trim any breaks at or beyond that position.
46 void SetMax(size_t max); 48 void SetMax(size_t max);
47 49
48 // Get the break applicable to |position| (at or preceeding |position|). 50 // Get the break applicable to |position| (at or preceeding |position|).
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 DCHECK_NE(breaks_[i].second, breaks_[i + 1].second) << "Redundant break."; 167 DCHECK_NE(breaks_[i].second, breaks_[i + 1].second) << "Redundant break.";
166 } 168 }
167 if (max_ > 0) 169 if (max_ > 0)
168 DCHECK_LT(breaks_.back().first, max_) << "Break beyond max position."; 170 DCHECK_LT(breaks_.back().first, max_) << "Break beyond max position.";
169 } 171 }
170 #endif 172 #endif
171 173
172 } // namespace gfx 174 } // namespace gfx
173 175
174 #endif // UI_GFX_BREAK_LIST_H_ 176 #endif // UI_GFX_BREAK_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text.h » ('j') | ui/gfx/render_text.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698