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

Unified Diff: ui/views/controls/textfield/textfield.h

Issue 73403002: Views Textfield: copy-on-select and paste-on-middle-click. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make UpdateSelectionClipboard a Textfield member. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.h
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 782a0b48b548d3e1569d6d44e13667ed5af26732..d8fe0c01aacf8f450210931dd6644a9ea1254890 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -307,9 +307,9 @@ class VIEWS_EXPORT Textfield : public View,
void PaintTextAndCursor(gfx::Canvas* canvas);
// Helper function to call MoveCursorTo on the TextfieldModel.
- bool MoveCursorTo(const gfx::Point& point, bool select);
+ void MoveCursorTo(const gfx::Point& point, bool select);
- // Convenience method to call InputMethod::OnCaretBoundsChanged();
+ // Convenience method to notify the InputMethod and TouchSelectionController.
void OnCaretBoundsChanged();
// Convenience method to call TextfieldController::OnBeforeUserAction();
@@ -343,6 +343,12 @@ class VIEWS_EXPORT Textfield : public View,
void CreateTouchSelectionControllerAndNotifyIt();
+ // Updates the selection clipboard to any non-empty text selection.
+ void UpdateSelectionClipboard() const;
+
+ // Pastes the selection clipboard for the specified mouse event.
+ void PasteSelectionClipboard(const ui::MouseEvent& event);
+
// The text model.
scoped_ptr<TextfieldModel> model_;
@@ -382,8 +388,9 @@ class VIEWS_EXPORT Textfield : public View,
// The input type of this text field.
ui::TextInputType text_input_type_;
- // The duration to reveal the last typed char for password textfields.
+ // The duration and timer to reveal the last typed password character.
base::TimeDelta password_reveal_duration_;
+ base::OneShotTimer<Textfield> password_reveal_timer_;
// True if InputMethod::CancelComposition() should not be called.
bool skip_input_method_cancel_composition_;
@@ -407,11 +414,6 @@ class VIEWS_EXPORT Textfield : public View,
scoped_ptr<ui::TouchSelectionController> touch_selection_controller_;
- // A timer to control the duration of showing the last typed char in
- // password text. When the timer is running, the last typed char is shown
- // and when the time expires, the last typed char is password.
- base::OneShotTimer<Textfield> password_reveal_timer_;
-
// Context menu related members.
scoped_ptr<ui::SimpleMenuModel> context_menu_contents_;
scoped_ptr<views::MenuRunner> context_menu_runner_;
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698