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

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: 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
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 void SetFocusPainter(scoped_ptr<Painter> focus_painter); 199 void SetFocusPainter(scoped_ptr<Painter> focus_painter);
200 200
201 // Returns whether there is a drag operation originating from the textfield. 201 // Returns whether there is a drag operation originating from the textfield.
202 bool HasTextBeingDragged(); 202 bool HasTextBeingDragged();
203 203
204 // View overrides: 204 // View overrides:
205 virtual int GetBaseline() const OVERRIDE; 205 virtual int GetBaseline() const OVERRIDE;
206 virtual gfx::Size GetPreferredSize() const OVERRIDE; 206 virtual gfx::Size GetPreferredSize() const OVERRIDE;
207 virtual const char* GetClassName() const OVERRIDE; 207 virtual const char* GetClassName() const OVERRIDE;
208 virtual void SetBorder(scoped_ptr<Border> b) OVERRIDE;
208 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; 209 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE;
209 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; 210 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
210 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; 211 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
211 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; 212 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
212 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; 213 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
213 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; 214 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
214 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; 215 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
215 virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE; 216 virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
216 virtual bool SkipDefaultKeyEventProcessing( 217 virtual bool SkipDefaultKeyEventProcessing(
217 const ui::KeyEvent& event) OVERRIDE; 218 const ui::KeyEvent& event) OVERRIDE;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 390
390 // True if this Textfield cannot accept input and is read-only. 391 // True if this Textfield cannot accept input and is read-only.
391 bool read_only_; 392 bool read_only_;
392 393
393 // The default number of average characters for the width of this text field. 394 // The default number of average characters for the width of this text field.
394 // This will be reported as the "desired size". Defaults to 0. 395 // This will be reported as the "desired size". Defaults to 0.
395 int default_width_in_chars_; 396 int default_width_in_chars_;
396 397
397 scoped_ptr<Painter> focus_painter_; 398 scoped_ptr<Painter> focus_painter_;
398 399
400 // Padding beyond the preferred size where text may be painted.
401 gfx::Insets internal_padding_;
402
399 // Flags indicating whether various system colors should be used, and if not, 403 // Flags indicating whether various system colors should be used, and if not,
400 // what overriding color values should be used instead. 404 // what overriding color values should be used instead.
401 bool use_default_text_color_; 405 bool use_default_text_color_;
402 bool use_default_background_color_; 406 bool use_default_background_color_;
403 bool use_default_selection_text_color_; 407 bool use_default_selection_text_color_;
404 bool use_default_selection_background_color_; 408 bool use_default_selection_background_color_;
405 SkColor text_color_; 409 SkColor text_color_;
406 SkColor background_color_; 410 SkColor background_color_;
407 SkColor selection_text_color_; 411 SkColor selection_text_color_;
408 SkColor selection_background_color_; 412 SkColor selection_background_color_;
(...skipping 59 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

Powered by Google App Engine
This is Rietveld 408576698