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

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: review comments 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
11 #if defined(OS_LINUX) 11 #if defined(OS_LINUX)
12 #include <gdk/gdk.h> 12 #include <gdk/gdk.h>
13 #endif 13 #endif
14 14
15 #include <string> 15 #include <string>
16 16
17 #include "base/basictypes.h" 17 #include "base/basictypes.h"
18 #include "base/compiler_specific.h" 18 #include "base/compiler_specific.h"
19 #include "base/string16.h" 19 #include "base/string16.h"
20 #include "third_party/skia/include/core/SkColor.h" 20 #include "third_party/skia/include/core/SkColor.h"
21 #include "ui/base/ime/text_input_type.h"
21 #include "ui/base/keycodes/keyboard_codes.h" 22 #include "ui/base/keycodes/keyboard_codes.h"
22 #include "ui/gfx/font.h" 23 #include "ui/gfx/font.h"
23 #include "ui/gfx/native_widget_types.h" 24 #include "ui/gfx/native_widget_types.h"
24 #include "views/controls/textfield/native_textfield_wrapper.h" 25 #include "views/controls/textfield/native_textfield_wrapper.h"
25 #include "views/view.h" 26 #include "views/view.h"
26 27
27 #if !defined(OS_LINUX) 28 #if !defined(OS_LINUX)
28 #include "base/logging.h" 29 #include "base/logging.h"
29 #endif 30 #endif
30 31
(...skipping 28 matching lines...) Expand all
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.
70 // TODO(bryeung): Currently this is only used in
71 // chrome/browser/chromeos/options/wifi_config_view.cc, which is being
72 // converted to WebUI. Please remove this when that happens.
69 bool IsPassword() const; 73 bool IsPassword() const;
70 void SetPassword(bool password); 74 void SetPassword(bool password);
71 75
76 // Gets/Sets the input type of this textfield.
77 ui::TextInputType GetTextInputType() const;
78 void SetTextInputType(ui::TextInputType type);
79
72 // Gets/Sets the text currently displayed in the Textfield. 80 // Gets/Sets the text currently displayed in the Textfield.
73 const string16& text() const { return text_; } 81 const string16& text() const { return text_; }
74 82
75 // Sets the text currently displayed in the Textfield. This doesn't 83 // Sets the text currently displayed in the Textfield. This doesn't
76 // change the cursor position if the current cursor is within the 84 // 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 85 // new text's range, or moves the cursor to the end if the cursor is
78 // out of the new text's range. 86 // out of the new text's range.
79 void SetText(const string16& text); 87 void SetText(const string16& text);
80 88
81 // Appends the given string to the previously-existing text in the field. 89 // Appends the given string to the previously-existing text in the field.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // Holds whether margins were set. 292 // Holds whether margins were set.
285 bool horizontal_margins_were_set_; 293 bool horizontal_margins_were_set_;
286 bool vertical_margins_were_set_; 294 bool vertical_margins_were_set_;
287 295
288 // Text to display when empty. 296 // Text to display when empty.
289 string16 text_to_display_when_empty_; 297 string16 text_to_display_when_empty_;
290 298
291 // The accessible name of the text field. 299 // The accessible name of the text field.
292 string16 accessible_name_; 300 string16 accessible_name_;
293 301
302 // The input type of this text field.
303 ui::TextInputType text_input_type_;
304
294 DISALLOW_COPY_AND_ASSIGN(Textfield); 305 DISALLOW_COPY_AND_ASSIGN(Textfield);
295 }; 306 };
296 307
297 } // namespace views 308 } // namespace views
298 309
299 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 310 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698