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

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

Issue 2031433002: Views::Textfield: Decouple handling of menu and text editing commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor2_virtual_calls
Patch Set: Address review comments. Created 4 years, 6 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Empty and invalid ranges are ignored. 196 // Empty and invalid ranges are ignored.
197 void SetStyle(gfx::TextStyle style, bool value); 197 void SetStyle(gfx::TextStyle style, bool value);
198 void ApplyStyle(gfx::TextStyle style, bool value, const gfx::Range& range); 198 void ApplyStyle(gfx::TextStyle style, bool value, const gfx::Range& range);
199 199
200 // Clears Edit history. 200 // Clears Edit history.
201 void ClearEditHistory(); 201 void ClearEditHistory();
202 202
203 // Set the accessible name of the text field. 203 // Set the accessible name of the text field.
204 void SetAccessibleName(const base::string16& name); 204 void SetAccessibleName(const base::string16& name);
205 205
206 // Performs the action associated with the specified command id.
207 void ExecuteCommand(int command_id);
208
209 // Returns whether there is a drag operation originating from the textfield. 206 // Returns whether there is a drag operation originating from the textfield.
210 bool HasTextBeingDragged(); 207 bool HasTextBeingDragged();
211 208
212 // View overrides: 209 // View overrides:
213 gfx::Insets GetInsets() const override; 210 gfx::Insets GetInsets() const override;
214 int GetBaseline() const override; 211 int GetBaseline() const override;
215 gfx::Size GetPreferredSize() const override; 212 gfx::Size GetPreferredSize() const override;
216 const char* GetClassName() const override; 213 const char* GetClassName() const override;
217 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; 214 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
218 bool OnMousePressed(const ui::MouseEvent& event) override; 215 bool OnMousePressed(const ui::MouseEvent& event) override;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 virtual void DoInsertChar(base::char16 ch); 311 virtual void DoInsertChar(base::char16 ch);
315 312
316 // Returns the TextfieldModel's text/cursor/selection rendering model. 313 // Returns the TextfieldModel's text/cursor/selection rendering model.
317 gfx::RenderText* GetRenderText() const; 314 gfx::RenderText* GetRenderText() const;
318 315
319 gfx::Point last_click_location() const { return last_click_location_; } 316 gfx::Point last_click_location() const { return last_click_location_; }
320 317
321 // Get the text from the selection clipboard. 318 // Get the text from the selection clipboard.
322 virtual base::string16 GetSelectionClipboardText() const; 319 virtual base::string16 GetSelectionClipboardText() const;
323 320
321 // Executes the given text editing command.
322 virtual void ExecuteEditCommand(int command_id);
323
324 private: 324 private:
325 friend class TextfieldTestApi; 325 friend class TextfieldTestApi;
326 326
327 // Handles a request to change the value of this text field from software 327 // Handles a request to change the value of this text field from software
328 // using an accessibility API (typically automation software, screen readers 328 // using an accessibility API (typically automation software, screen readers
329 // don't normally use this). Sets the value and clears the selection. 329 // don't normally use this). Sets the value and clears the selection.
330 void AccessibilitySetValue(const base::string16& new_value); 330 void AccessibilitySetValue(const base::string16& new_value);
331 331
332 // Updates the painted background color. 332 // Updates the painted background color.
333 void UpdateBackgroundColor(); 333 void UpdateBackgroundColor();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 // Used to bind callback functions to this object. 485 // Used to bind callback functions to this object.
486 base::WeakPtrFactory<Textfield> weak_ptr_factory_; 486 base::WeakPtrFactory<Textfield> weak_ptr_factory_;
487 487
488 DISALLOW_COPY_AND_ASSIGN(Textfield); 488 DISALLOW_COPY_AND_ASSIGN(Textfield);
489 }; 489 };
490 490
491 } // namespace views 491 } // namespace views
492 492
493 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 493 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698