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

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

Issue 10310131: Support placeholder text in NativeTextfieldViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #3 Created 8 years, 7 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_views.cc ('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 778586bc33f73d5565e7c41b48dab094c56e020c..163a71b2a70ff97825e95b21de0e9097b2e48a6b 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -6,13 +6,12 @@
#define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
#pragma once
-#include "build/build_config.h"
-
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/string16.h"
+#include "build/build_config.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/ime/text_input_type.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -157,14 +156,19 @@ class VIEWS_EXPORT Textfield : public View {
void RemoveBorder();
// Sets the text to display when empty.
- void set_text_to_display_when_empty(const string16& text) {
- text_to_display_when_empty_ = text;
+ void set_placeholder_text(const string16& text) {
+ placeholder_text_ = text;
#if !defined(OS_LINUX)
NOTIMPLEMENTED();
#endif
}
- const string16& text_to_display_when_empty() {
- return text_to_display_when_empty_;
+ const string16& placeholder_text() const {
+ return placeholder_text_;
+ }
+
+ SkColor placeholder_text_color() const { return placeholder_text_color_; }
+ void set_placeholder_text_color(SkColor color) {
+ placeholder_text_color_ = color;
}
// Getter for the horizontal margins that were set. Returns false if
@@ -306,7 +310,10 @@ class VIEWS_EXPORT Textfield : public View {
bool vertical_margins_were_set_;
// Text to display when empty.
- string16 text_to_display_when_empty_;
+ string16 placeholder_text_;
+
+ // Placeholder text color.
+ SkColor placeholder_text_color_;
// The accessible name of the text field.
string16 accessible_name_;
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698