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

Side by Side Diff: ui/views/selection_controller.h

Issue 2580293003: MacViews: Select word under cursor on right click. (Closed)
Patch Set: -- Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SELECTION_CONTROLLER_H_ 5 #ifndef UI_VIEWS_SELECTION_CONTROLLER_H_
6 #define UI_VIEWS_SELECTION_CONTROLLER_H_ 6 #define UI_VIEWS_SELECTION_CONTROLLER_H_
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "ui/gfx/geometry/point.h" 10 #include "ui/gfx/geometry/point.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Sets whether the SelectionController should update or paste the 46 // Sets whether the SelectionController should update or paste the
47 // selection clipboard on middle-click. Default is false. 47 // selection clipboard on middle-click. Default is false.
48 void set_handles_selection_clipboard(bool value) { 48 void set_handles_selection_clipboard(bool value) {
49 handles_selection_clipboard_ = value; 49 handles_selection_clipboard_ = value;
50 } 50 }
51 51
52 private: 52 private:
53 // Tracks the mouse clicks for single/double/triple clicks. 53 // Tracks the mouse clicks for single/double/triple clicks.
54 void TrackMouseClicks(const ui::MouseEvent& event); 54 void TrackMouseClicks(const ui::MouseEvent& event);
55 55
56 // Selects word at the given |point|.
tapted 2016/12/19 06:49:16 nit: word -> the word
karandeepb 2016/12/19 07:05:43 Done.
57 void SelectWord(const gfx::Point& point);
58
56 // Returns the associated render text instance via the |delegate_|. 59 // Returns the associated render text instance via the |delegate_|.
57 gfx::RenderText* GetRenderText(); 60 gfx::RenderText* GetRenderText();
58 61
59 // Helper function to update the selection on a mouse drag as per 62 // Helper function to update the selection on a mouse drag as per
60 // |last_drag_location_|. Can be called asynchronously, through a timer. 63 // |last_drag_location_|. Can be called asynchronously, through a timer.
61 void SelectThroughLastDragLocation(); 64 void SelectThroughLastDragLocation();
62 65
63 // A timer and point used to modify the selection when dragging. 66 // A timer and point used to modify the selection when dragging.
64 base::RepeatingTimer drag_selection_timer_; 67 base::RepeatingTimer drag_selection_timer_;
65 gfx::Point last_drag_location_; 68 gfx::Point last_drag_location_;
(...skipping 15 matching lines...) Expand all
81 84
82 // Whether the selection clipboard is handled. 85 // Whether the selection clipboard is handled.
83 bool handles_selection_clipboard_; 86 bool handles_selection_clipboard_;
84 87
85 DISALLOW_COPY_AND_ASSIGN(SelectionController); 88 DISALLOW_COPY_AND_ASSIGN(SelectionController);
86 }; 89 };
87 90
88 } // namespace views 91 } // namespace views
89 92
90 #endif // UI_VIEWS_SELECTION_CONTROLLER_H_ 93 #endif // UI_VIEWS_SELECTION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698