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

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

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 7 years, 11 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
« no previous file with comments | « ui/views/controls/textfield/native_textfield_wrapper.h ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.h
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 57509ea64781631823bf7cf243fa8d738d5f073b..33101b19c110ccb84e086e18d8f9d5cc64d05daf 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -16,6 +16,7 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/gfx/font.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/text_constants.h"
#include "ui/views/controls/textfield/native_textfield_wrapper.h"
#include "ui/views/view.h"
@@ -23,10 +24,6 @@
#include "base/logging.h"
#endif
-namespace gfx {
-struct StyleRange;
-} // namespace gfx
-
namespace ui {
class Range;
class TextInputClient;
@@ -209,14 +206,18 @@ class VIEWS_EXPORT Textfield : public View {
// only and has to be called after the wrapper is created.
size_t GetCursorPosition() const;
- // 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
+ // Set the text color over the entire text or a logical character range.
+ // Empty and invalid ranges are ignored. This is views-implementation only and
// has to be called after the wrapper is created.
- void ApplyStyleRange(const gfx::StyleRange& style);
+ void SetColor(SkColor value);
+ void ApplyColor(SkColor value, const ui::Range& range);
- // Applies the default style to the textfield. This is views-implementation
- // only and has to be called after the wrapper is created.
- void ApplyDefaultStyle();
+ // Set various text styles over the entire text or a logical character range.
+ // The respective |style| is applied if |value| is true, or removed if false.
+ // Empty and invalid ranges are ignored. This is views-implementation only and
+ // has to be called after the wrapper is created.
+ void SetStyle(gfx::TextStyle style, bool value);
+ void ApplyStyle(gfx::TextStyle style, bool value, const ui::Range& range);
// Clears Edit history.
void ClearEditHistory();
« no previous file with comments | « ui/views/controls/textfield/native_textfield_wrapper.h ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698