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

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

Issue 516943003: Add textfield internal padding from FocusableBorder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore Insets const ref. Created 6 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
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 27 matching lines...) Expand all
38 class VIEWS_EXPORT Textfield : public View, 38 class VIEWS_EXPORT Textfield : public View,
39 public TextfieldModel::Delegate, 39 public TextfieldModel::Delegate,
40 public ContextMenuController, 40 public ContextMenuController,
41 public DragController, 41 public DragController,
42 public ui::TouchEditable, 42 public ui::TouchEditable,
43 public ui::TextInputClient { 43 public ui::TextInputClient {
44 public: 44 public:
45 // The textfield's class name. 45 // The textfield's class name.
46 static const char kViewClassName[]; 46 static const char kViewClassName[];
47 47
48 // The preferred size of the padding to be used around textfield text.
49 static const int kTextPadding;
50
48 // Returns the text cursor blink time in milliseconds, or 0 for no blinking. 51 // Returns the text cursor blink time in milliseconds, or 0 for no blinking.
49 static size_t GetCaretBlinkMs(); 52 static size_t GetCaretBlinkMs();
50 53
51 Textfield(); 54 Textfield();
52 virtual ~Textfield(); 55 virtual ~Textfield();
53 56
54 // Set the controller for this textfield. 57 // Set the controller for this textfield.
55 void set_controller(TextfieldController* controller) { 58 void set_controller(TextfieldController* controller) {
56 controller_ = controller; 59 controller_ = controller;
57 } 60 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 198
196 // Performs the action associated with the specified command id. 199 // Performs the action associated with the specified command id.
197 void ExecuteCommand(int command_id); 200 void ExecuteCommand(int command_id);
198 201
199 void SetFocusPainter(scoped_ptr<Painter> focus_painter); 202 void SetFocusPainter(scoped_ptr<Painter> focus_painter);
200 203
201 // Returns whether there is a drag operation originating from the textfield. 204 // Returns whether there is a drag operation originating from the textfield.
202 bool HasTextBeingDragged(); 205 bool HasTextBeingDragged();
203 206
204 // View overrides: 207 // View overrides:
208 virtual gfx::Insets GetInsets() const OVERRIDE;
205 virtual int GetBaseline() const OVERRIDE; 209 virtual int GetBaseline() const OVERRIDE;
206 virtual gfx::Size GetPreferredSize() const OVERRIDE; 210 virtual gfx::Size GetPreferredSize() const OVERRIDE;
207 virtual const char* GetClassName() const OVERRIDE; 211 virtual const char* GetClassName() const OVERRIDE;
208 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; 212 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
209 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; 213 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
210 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; 214 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
211 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; 215 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
212 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 216 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
213 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; 217 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
214 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 218 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 472
469 // Used to bind callback functions to this object. 473 // Used to bind callback functions to this object.
470 base::WeakPtrFactory<Textfield> weak_ptr_factory_; 474 base::WeakPtrFactory<Textfield> weak_ptr_factory_;
471 475
472 DISALLOW_COPY_AND_ASSIGN(Textfield); 476 DISALLOW_COPY_AND_ASSIGN(Textfield);
473 }; 477 };
474 478
475 } // namespace views 479 } // namespace views
476 480
477 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 481 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698