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

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

Issue 7841056: fix know issues in RenderText (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: aupdate RenderTextWin. update test for Win platform. upload RenderTextTest that was missed Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_WIN_H_ 5 #ifndef UI_GFX_RENDER_TEXT_WIN_H_
6 #define UI_GFX_RENDER_TEXT_WIN_H_ 6 #define UI_GFX_RENDER_TEXT_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <usp10.h> 9 #include <usp10.h>
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Overridden from RenderText: 56 // Overridden from RenderText:
57 virtual void SetText(const string16& text) OVERRIDE; 57 virtual void SetText(const string16& text) OVERRIDE;
58 virtual void SetDisplayRect(const Rect& r) OVERRIDE; 58 virtual void SetDisplayRect(const Rect& r) OVERRIDE;
59 virtual void ApplyStyleRange(StyleRange style_range) OVERRIDE; 59 virtual void ApplyStyleRange(StyleRange style_range) OVERRIDE;
60 virtual void ApplyDefaultStyle() OVERRIDE; 60 virtual void ApplyDefaultStyle() OVERRIDE;
61 virtual int GetStringWidth() OVERRIDE; 61 virtual int GetStringWidth() OVERRIDE;
62 virtual void Draw(Canvas* canvas) OVERRIDE; 62 virtual void Draw(Canvas* canvas) OVERRIDE;
63 virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE; 63 virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE;
64 virtual Rect GetCursorBounds(const SelectionModel& selection, 64 virtual Rect GetCursorBounds(const SelectionModel& selection,
65 bool insert_mode) OVERRIDE; 65 bool insert_mode) OVERRIDE;
66 virtual size_t GetIndexOfNextGrapheme(size_t position) OVERRIDE;
66 67
67 protected: 68 protected:
68 // Overridden from RenderText: 69 // Overridden from RenderText:
69 virtual SelectionModel GetLeftSelectionModel(const SelectionModel& current, 70 virtual SelectionModel GetLeftSelectionModel(const SelectionModel& current,
70 BreakType break_type) OVERRIDE; 71 BreakType break_type) OVERRIDE;
71 virtual SelectionModel GetRightSelectionModel(const SelectionModel& current, 72 virtual SelectionModel GetRightSelectionModel(const SelectionModel& current,
72 BreakType break_type) OVERRIDE; 73 BreakType break_type) OVERRIDE;
73 virtual SelectionModel LeftEndSelectionModel() OVERRIDE; 74 virtual SelectionModel LeftEndSelectionModel() OVERRIDE;
74 virtual SelectionModel RightEndSelectionModel() OVERRIDE; 75 virtual SelectionModel RightEndSelectionModel() OVERRIDE;
75 virtual size_t GetIndexOfPreviousGrapheme(size_t position) OVERRIDE; 76 virtual size_t GetIndexOfPreviousGrapheme(size_t position) OVERRIDE;
76 virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to) OVERRIDE; 77 virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to) OVERRIDE;
78 virtual bool IsCursorablePosition(size_t position) OVERRIDE;
77 79
78 private: 80 private:
79 void ItemizeLogicalText(); 81 void ItemizeLogicalText();
80 void LayoutVisualText(HDC hdc); 82 void LayoutVisualText(HDC hdc);
81 83
82 // Return the run index that contains the argument; or the length of the 84 // Return the run index that contains the argument; or the length of the
83 // |runs_| vector if argument exceeds the text length or width. 85 // |runs_| vector if argument exceeds the text length or width.
84 size_t GetRunContainingPosition(size_t position) const; 86 size_t GetRunContainingPosition(size_t position) const;
85 size_t GetRunContainingPoint(const Point& point) const; 87 size_t GetRunContainingPoint(const Point& point) const;
86 88
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 122
121 scoped_array<int> visual_to_logical_; 123 scoped_array<int> visual_to_logical_;
122 scoped_array<int> logical_to_visual_; 124 scoped_array<int> logical_to_visual_;
123 125
124 DISALLOW_COPY_AND_ASSIGN(RenderTextWin); 126 DISALLOW_COPY_AND_ASSIGN(RenderTextWin);
125 }; 127 };
126 128
127 } // namespace gfx; 129 } // namespace gfx;
128 130
129 #endif // UI_GFX_RENDER_TEXT_WIN_H_ 131 #endif // UI_GFX_RENDER_TEXT_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698