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

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

Issue 2556083002: Don't subtract border from max size for display rect. (Closed)
Patch Set: Created 4 years 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/views/corewm/tooltip_aura.h » ('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 UI_GFX_RENDER_TEXT_H_ 5 #ifndef UI_GFX_RENDER_TEXT_H_
6 #define UI_GFX_RENDER_TEXT_H_ 6 #define UI_GFX_RENDER_TEXT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // at the point, returns a nearby word. |baseline_point| should correspond to 521 // at the point, returns a nearby word. |baseline_point| should correspond to
522 // the baseline point of the leftmost glyph of the |word| in the view's 522 // the baseline point of the leftmost glyph of the |word| in the view's
523 // coordinates. Returns false, if no word can be retrieved. 523 // coordinates. Returns false, if no word can be retrieved.
524 bool GetDecoratedWordAtPoint(const Point& point, 524 bool GetDecoratedWordAtPoint(const Point& point,
525 DecoratedText* decorated_word, 525 DecoratedText* decorated_word,
526 Point* baseline_point); 526 Point* baseline_point);
527 527
528 // Retrieves the text in the given |range|. 528 // Retrieves the text in the given |range|.
529 base::string16 GetTextFromRange(const Range& range) const; 529 base::string16 GetTextFromRange(const Range& range) const;
530 530
531 // Returns the number of text lines, only for unit test.
532 size_t line_size_for_test() const { return lines_.size(); }
sky 2016/12/07 17:09:37 Add to test::RenderTextTestApi ?
oshima 2016/12/13 14:22:18 Extracted to a separate file. PTAL.
533
531 protected: 534 protected:
532 RenderText(); 535 RenderText();
533 536
534 // NOTE: The value of these accessors may be stale. Please make sure 537 // NOTE: The value of these accessors may be stale. Please make sure
535 // that these fields are up to date before accessing them. 538 // that these fields are up to date before accessing them.
536 const base::string16& layout_text() const { return layout_text_; } 539 const base::string16& layout_text() const { return layout_text_; }
537 const base::string16& display_text() const { return display_text_; } 540 const base::string16& display_text() const { return display_text_; }
538 bool text_elided() const { return text_elided_; } 541 bool text_elided() const { return text_elided_; }
539 542
540 const BreakList<SkColor>& colors() const { return colors_; } 543 const BreakList<SkColor>& colors() const { return colors_; }
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 // Lines computed by EnsureLayout. These should be invalidated upon 864 // Lines computed by EnsureLayout. These should be invalidated upon
862 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. 865 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls.
863 std::vector<internal::Line> lines_; 866 std::vector<internal::Line> lines_;
864 867
865 DISALLOW_COPY_AND_ASSIGN(RenderText); 868 DISALLOW_COPY_AND_ASSIGN(RenderText);
866 }; 869 };
867 870
868 } // namespace gfx 871 } // namespace gfx
869 872
870 #endif // UI_GFX_RENDER_TEXT_H_ 873 #endif // UI_GFX_RENDER_TEXT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/corewm/tooltip_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698