| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BASE_MODELS_MENU_MODEL_DELEGATE_H_ | 5 #ifndef UI_BASE_MODELS_MENU_MODEL_DELEGATE_H_ |
| 6 #define UI_BASE_MODELS_MENU_MODEL_DELEGATE_H_ | 6 #define UI_BASE_MODELS_MENU_MODEL_DELEGATE_H_ |
| 7 | 7 |
| 8 namespace ui { | 8 namespace ui { |
| 9 | 9 |
| 10 class MenuModelDelegate { | 10 class MenuModelDelegate { |
| 11 public: | 11 public: |
| 12 // Invoked when an icon has been loaded from history. | 12 // Invoked when an icon has been loaded from history. |
| 13 virtual void OnIconChanged(int index) = 0; | 13 virtual void OnIconChanged(int index) = 0; |
| 14 | 14 |
| 15 // Invoked prior to any calls to OnItemAdded()/OnItemRemoved(). |
| 16 virtual void PrepareForChange() {} |
| 17 |
| 18 // Invoked when adding and removing items in MenuModel, delegate should |
| 19 // add or remove items to or from the menu as per the model. |
| 20 virtual void OnItemAdded(int index) {} |
| 21 virtual void OnItemRemoved(int index) {} |
| 22 |
| 23 // Invoked when MenuModel has finisheed the changes, delegate should finalize |
| 24 // the menu and update the UI. |
| 25 virtual void ChangesDone() {} |
| 26 |
| 15 protected: | 27 protected: |
| 16 virtual ~MenuModelDelegate() {} | 28 virtual ~MenuModelDelegate() {} |
| 17 }; | 29 }; |
| 18 | 30 |
| 19 } // namespace ui | 31 } // namespace ui |
| 20 | 32 |
| 21 #endif // UI_BASE_MODELS_MENU_MODEL_DELEGATE_H_ | 33 #endif // UI_BASE_MODELS_MENU_MODEL_DELEGATE_H_ |
| OLD | NEW |