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

Unified Diff: ui/views/selection_controller.h

Issue 2650963002: MacViews: Select all text on right clicking an unfocused text view. (Closed)
Patch Set: Nit Created 3 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 | « ui/views/controls/textfield/textfield_unittest.cc ('k') | ui/views/selection_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/selection_controller.h
diff --git a/ui/views/selection_controller.h b/ui/views/selection_controller.h
index 8a410e9e148aac9aa1f15d4d419a9fb56646bb3f..3a2279bef552273c73c943d78ee85b1a36df81b4 100644
--- a/ui/views/selection_controller.h
+++ b/ui/views/selection_controller.h
@@ -28,6 +28,13 @@ class SelectionControllerDelegate;
// TODO(karandeepb): Also make this class handle gesture events.
class VIEWS_EXPORT SelectionController {
public:
+ // Describes whether the view managing the delegate was initially focused when
+ // the mouse press was received.
+ enum InitialFocusStateOnMousePress {
+ FOCUSED,
+ UNFOCUSED,
+ };
+
// |delegate| must be non-null.
explicit SelectionController(SelectionControllerDelegate* delegate);
@@ -35,7 +42,9 @@ class VIEWS_EXPORT SelectionController {
// the event has already been handled by the |delegate_|. If |handled| is
// true, the mouse event is just used to update the internal state without
// updating the state of the associated RenderText instance.
- bool OnMousePressed(const ui::MouseEvent& event, bool handled);
+ bool OnMousePressed(const ui::MouseEvent& event,
+ bool handled,
+ InitialFocusStateOnMousePress initial_focus_state);
bool OnMouseDragged(const ui::MouseEvent& event);
void OnMouseReleased(const ui::MouseEvent& event);
void OnMouseCaptureLost();
@@ -56,6 +65,9 @@ class VIEWS_EXPORT SelectionController {
// Selects the word at the given |point|.
void SelectWord(const gfx::Point& point);
+ // Selects all the text.
+ void SelectAll();
+
// Returns the associated render text instance via the |delegate_|.
gfx::RenderText* GetRenderText();
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | ui/views/selection_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698