| OLD | NEW |
| 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_CONTROLLER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ |
| 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 const base::string16& new_contents) {} | 32 const base::string16& new_contents) {} |
| 33 | 33 |
| 34 // This method is called to get notified about keystrokes in the edit. | 34 // This method is called to get notified about keystrokes in the edit. |
| 35 // Returns true if the message was handled and should not be processed | 35 // Returns true if the message was handled and should not be processed |
| 36 // further. If it returns false the processing continues. | 36 // further. If it returns false the processing continues. |
| 37 virtual bool HandleKeyEvent(Textfield* sender, | 37 virtual bool HandleKeyEvent(Textfield* sender, |
| 38 const ui::KeyEvent& key_event); | 38 const ui::KeyEvent& key_event); |
| 39 | 39 |
| 40 // This method is called to get notified about mouse events in the edit. | 40 // This method is called to get notified about mouse events in the edit. |
| 41 // Returns true if the message was handled and should not be processed | 41 // Returns true if the message was handled and should not be processed |
| 42 // further. Currently, only mouse down events are sent here. | 42 // further. Currently, only mouse down events and mouse wheel events are sent |
| 43 // here. |
| 43 virtual bool HandleMouseEvent(Textfield* sender, | 44 virtual bool HandleMouseEvent(Textfield* sender, |
| 44 const ui::MouseEvent& mouse_event); | 45 const ui::MouseEvent& mouse_event); |
| 45 | 46 |
| 46 // Called before performing a user action that may change the textfield. | 47 // Called before performing a user action that may change the textfield. |
| 47 // It's currently only supported by Views implementation. | 48 // It's currently only supported by Views implementation. |
| 48 virtual void OnBeforeUserAction(Textfield* sender) {} | 49 virtual void OnBeforeUserAction(Textfield* sender) {} |
| 49 | 50 |
| 50 // Called after performing a user action that may change the textfield. | 51 // Called after performing a user action that may change the textfield. |
| 51 // It's currently only supported by Views implementation. | 52 // It's currently only supported by Views implementation. |
| 52 virtual void OnAfterUserAction(Textfield* sender) {} | 53 virtual void OnAfterUserAction(Textfield* sender) {} |
| (...skipping 26 matching lines...) Expand all Loading... |
| 79 // Gives the controller a chance to modify the context menu contents. | 80 // Gives the controller a chance to modify the context menu contents. |
| 80 virtual void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) {} | 81 virtual void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) {} |
| 81 | 82 |
| 82 protected: | 83 protected: |
| 83 virtual ~TextfieldController() {} | 84 virtual ~TextfieldController() {} |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace views | 87 } // namespace views |
| 87 | 88 |
| 88 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ | 89 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ |
| OLD | NEW |