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

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

Issue 1155008: Adds the ability to display text in a textfield when the text is (Closed)
Patch Set: Updates Created 10 years, 9 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 | « views/controls/textfield/native_textfield_gtk.cc ('k') | views/examples/textfield_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/textfield.h
diff --git a/views/controls/textfield/textfield.h b/views/controls/textfield/textfield.h
index 71bdf4975b761ae17df96c23710b461cadec07fe..5bc391611c977f248d4d996151aada97beb6bd06 100644
--- a/views/controls/textfield/textfield.h
+++ b/views/controls/textfield/textfield.h
@@ -14,6 +14,7 @@
#include "app/gfx/font.h"
#include "base/basictypes.h"
#include "base/keyboard_codes.h"
+#include "base/logging.h"
#include "base/string16.h"
#include "views/view.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -178,12 +179,23 @@ class Textfield : public View {
// Sets the default width of the text control. See default_width_in_chars_.
void set_default_width_in_chars(int default_width) {
default_width_in_chars_ = default_width;
+#if !defined(OS_LINUX)
+ NOTIMPLEMENTED();
+#endif
}
// Removes the border from the edit box, giving it a 2D look.
bool draw_border() const { return draw_border_; }
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;
+ }
+ const string16& text_to_display_when_empty() {
+ return text_to_display_when_empty_;
+ }
+
// Updates all properties on the textfield. This is invoked internally.
// Users of Textfield never need to invoke this directly.
void UpdateAllProperties();
@@ -274,6 +286,9 @@ class Textfield : public View {
// The storage string for the accessibility name associated with this control.
std::wstring accessible_name_;
+ // Text to display when empty.
+ string16 text_to_display_when_empty_;
+
DISALLOW_COPY_AND_ASSIGN(Textfield);
};
« no previous file with comments | « views/controls/textfield/native_textfield_gtk.cc ('k') | views/examples/textfield_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698