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

Side by Side Diff: views/controls/textfield/textfield.h

Issue 7826039: Identify the omnibox as a URL field. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // This class implements a View that wraps a native text (edit) field. 44 // This class implements a View that wraps a native text (edit) field.
45 class VIEWS_EXPORT Textfield : public View { 45 class VIEWS_EXPORT Textfield : public View {
46 public: 46 public:
47 // The button's class name. 47 // The button's class name.
48 static const char kViewClassName[]; 48 static const char kViewClassName[];
49 49
50 enum StyleFlags { 50 enum StyleFlags {
51 STYLE_DEFAULT = 0, 51 STYLE_DEFAULT = 0,
52 STYLE_PASSWORD = 1 << 0, 52 STYLE_PASSWORD = 1 << 0,
53 STYLE_LOWERCASE = 1 << 1 53 STYLE_LOWERCASE = 1 << 1,
54 STYLE_URL = 1 << 2
oshima 2011/09/02 20:54:02 I'm a bit worried about expanding this for input t
54 }; 55 };
55 56
56 Textfield(); 57 Textfield();
57 explicit Textfield(StyleFlags style); 58 explicit Textfield(StyleFlags style);
58 virtual ~Textfield(); 59 virtual ~Textfield();
59 60
60 // TextfieldController accessors 61 // TextfieldController accessors
61 void SetController(TextfieldController* controller); 62 void SetController(TextfieldController* controller);
62 TextfieldController* GetController() const; 63 TextfieldController* GetController() const;
63 64
64 // Gets/Sets whether or not the Textfield is read-only. 65 // Gets/Sets whether or not the Textfield is read-only.
65 bool read_only() const { return read_only_; } 66 bool read_only() const { return read_only_; }
66 void SetReadOnly(bool read_only); 67 void SetReadOnly(bool read_only);
67 68
68 // Gets/Sets whether or not this Textfield is a password field. 69 // Gets/Sets whether or not this Textfield is a password field.
69 bool IsPassword() const; 70 bool IsPassword() const;
70 void SetPassword(bool password); 71 void SetPassword(bool password);
71 72
73 // Gets/Sets whether or not this Textfield is a URL field.
74 bool IsUrl() const;
75 void SetUrl(bool password);
76
72 // Gets/Sets the text currently displayed in the Textfield. 77 // Gets/Sets the text currently displayed in the Textfield.
73 const string16& text() const { return text_; } 78 const string16& text() const { return text_; }
74 79
75 // Sets the text currently displayed in the Textfield. This doesn't 80 // Sets the text currently displayed in the Textfield. This doesn't
76 // change the cursor position if the current cursor is within the 81 // change the cursor position if the current cursor is within the
77 // new text's range, or moves the cursor to the end if the cursor is 82 // new text's range, or moves the cursor to the end if the cursor is
78 // out of the new text's range. 83 // out of the new text's range.
79 void SetText(const string16& text); 84 void SetText(const string16& text);
80 85
81 // Appends the given string to the previously-existing text in the field. 86 // Appends the given string to the previously-existing text in the field.
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 295
291 // The accessible name of the text field. 296 // The accessible name of the text field.
292 string16 accessible_name_; 297 string16 accessible_name_;
293 298
294 DISALLOW_COPY_AND_ASSIGN(Textfield); 299 DISALLOW_COPY_AND_ASSIGN(Textfield);
295 }; 300 };
296 301
297 } // namespace views 302 } // namespace views
298 303
299 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 304 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW
« no previous file with comments | « views/controls/textfield/native_textfield_views_unittest.cc ('k') | views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698