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

Unified Diff: views/controls/textfield/textfield.h

Issue 7265011: RenderText API Outline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODO comments, revise cursor movement API, etc. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: views/controls/textfield/textfield.h
diff --git a/views/controls/textfield/textfield.h b/views/controls/textfield/textfield.h
index 3965050fa2f2a338652b9660508283d030496573..66675d53ca81d45baa390e668a5f77757101ee51 100644
--- a/views/controls/textfield/textfield.h
+++ b/views/controls/textfield/textfield.h
@@ -30,6 +30,10 @@
#include "views/controls/textfield/native_textfield_wrapper.h"
#endif
+namespace gfx {
+struct StyleRange;
+} // namespace gfx
+
namespace ui {
class Range;
} // namespace ui
@@ -39,7 +43,6 @@ namespace views {
class KeyEvent;
class NativeTextfieldWrapper;
class TextfieldController;
-class TextStyle;
// This class implements a View that wraps a native text (edit) field.
class Textfield : public View {
@@ -186,24 +189,14 @@ class Textfield : public View {
// only and has to be called after the wrapper is created.
size_t GetCursorPosition() const;
- // Creates a new TextStyle for this textfield. The object is owned
- // by the textfield and gets deleted when the textfield is deleted.
- // This is views-implementation only and has to be called after the
- // wrapper is created.
- TextStyle* CreateTextStyle();
-
- // Applies the |style| to the text specified by the |range|. If
- // there is already a style applied in the |range|, the style of the
- // overlapping part will be replaced by this sytle. The style will
- // be ignored if range is empty or invalid. This is
- // views-implementation only and has to be called after the wrapper
- // is created.
- void ApplyTextStyle(const TextStyle* style, const ui::Range& range);
-
- // Clears All TextStyles.
- // This is views-implementation only and has to be called after the
- // wrapper is created.
- void ClearAllTextStyles();
+ // Applies |style| to the text specified by its range. The style will be
+ // ignored if range is empty or invalid. This is views-implementation only and
+ // has to be called after the wrapper is created.
+ void ApplyStyleRange(const gfx::StyleRange& style);
+
+ // Applies the default style to the textfield. This is views-implementation
+ // only and has to be called after the wrapper is created.
+ void ApplyDefaultStyle();
// Clears Edit history.
void ClearEditHistory();

Powered by Google App Engine
This is Rietveld 408576698