| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "ui/views/views_export.h" | 10 #include "ui/views/views_export.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 virtual void OnAfterCutOrCopy() {} | 47 virtual void OnAfterCutOrCopy() {} |
| 48 | 48 |
| 49 // Called after the textfield has written drag data to give the controller a | 49 // Called after the textfield has written drag data to give the controller a |
| 50 // chance to modify the drag data. | 50 // chance to modify the drag data. |
| 51 virtual void OnWriteDragData(ui::OSExchangeData* data) {} | 51 virtual void OnWriteDragData(ui::OSExchangeData* data) {} |
| 52 | 52 |
| 53 // Gives the controller a chance to modify the context menu contents. | 53 // Gives the controller a chance to modify the context menu contents. |
| 54 virtual void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) {} | 54 virtual void UpdateContextMenu(ui::SimpleMenuModel* menu_contents) {} |
| 55 | 55 |
| 56 // Returns true if the |command_id| should be enabled in the context menu. | 56 // Returns true if the |command_id| should be enabled in the context menu. |
| 57 virtual bool IsCommandIdEnabled(int command_id) const; | 57 virtual bool IsCommandIdEnabled(int command_id) const { return false; } |
| 58 | 58 |
| 59 // Execute context menu command specified by |command_id|. | 59 // Execute context menu command specified by |command_id|. |
| 60 virtual void ExecuteCommand(int command_id) {} | 60 virtual void ExecuteCommand(int command_id) {} |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 virtual ~TextfieldController() {} | 63 virtual ~TextfieldController() {} |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace views | 66 } // namespace views |
| 67 | 67 |
| 68 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ | 68 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_CONTROLLER_H_ |
| OLD | NEW |