| 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_EXAMPLES_TREE_VIEW_EXAMPLE_H_ | 5 #ifndef UI_VIEWS_EXAMPLES_TREE_VIEW_EXAMPLE_H_ |
| 6 #define UI_VIEWS_EXAMPLES_TREE_VIEW_EXAMPLE_H_ | 6 #define UI_VIEWS_EXAMPLES_TREE_VIEW_EXAMPLE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/base/models/simple_menu_model.h" | 9 #include "ui/base/models/simple_menu_model.h" |
| 10 #include "ui/base/models/tree_node_model.h" | 10 #include "ui/base/models/tree_node_model.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool CanEdit(TreeView* tree_view, ui::TreeModelNode* node) override; | 56 bool CanEdit(TreeView* tree_view, ui::TreeModelNode* node) override; |
| 57 | 57 |
| 58 // ContextMenuController: | 58 // ContextMenuController: |
| 59 void ShowContextMenuForView(View* source, | 59 void ShowContextMenuForView(View* source, |
| 60 const gfx::Point& point, | 60 const gfx::Point& point, |
| 61 ui::MenuSourceType source_type) override; | 61 ui::MenuSourceType source_type) override; |
| 62 | 62 |
| 63 // SimpleMenuModel::Delegate: | 63 // SimpleMenuModel::Delegate: |
| 64 bool IsCommandIdChecked(int command_id) const override; | 64 bool IsCommandIdChecked(int command_id) const override; |
| 65 bool IsCommandIdEnabled(int command_id) const override; | 65 bool IsCommandIdEnabled(int command_id) const override; |
| 66 bool GetAcceleratorForCommandId(int command_id, | |
| 67 ui::Accelerator* accelerator) const override; | |
| 68 void ExecuteCommand(int command_id, int event_flags) override; | 66 void ExecuteCommand(int command_id, int event_flags) override; |
| 69 | 67 |
| 70 // The tree view to be tested. | 68 // The tree view to be tested. |
| 71 TreeView* tree_view_; | 69 TreeView* tree_view_; |
| 72 | 70 |
| 73 // Control buttons to modify the model. | 71 // Control buttons to modify the model. |
| 74 LabelButton* add_; | 72 LabelButton* add_; |
| 75 LabelButton* remove_; | 73 LabelButton* remove_; |
| 76 LabelButton* change_title_; | 74 LabelButton* change_title_; |
| 77 | 75 |
| 78 typedef ui::TreeNodeWithValue<int> NodeType; | 76 typedef ui::TreeNodeWithValue<int> NodeType; |
| 79 | 77 |
| 80 ui::TreeNodeModel<NodeType> model_; | 78 ui::TreeNodeModel<NodeType> model_; |
| 81 | 79 |
| 82 std::unique_ptr<MenuRunner> context_menu_runner_; | 80 std::unique_ptr<MenuRunner> context_menu_runner_; |
| 83 | 81 |
| 84 DISALLOW_COPY_AND_ASSIGN(TreeViewExample); | 82 DISALLOW_COPY_AND_ASSIGN(TreeViewExample); |
| 85 }; | 83 }; |
| 86 | 84 |
| 87 } // namespace examples | 85 } // namespace examples |
| 88 } // namespace views | 86 } // namespace views |
| 89 | 87 |
| 90 #endif // UI_VIEWS_EXAMPLES_TREE_VIEW_EXAMPLE_H_ | 88 #endif // UI_VIEWS_EXAMPLES_TREE_VIEW_EXAMPLE_H_ |
| OLD | NEW |