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

Side by Side Diff: ui/views/examples/tree_view_example.cc

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 #include "ui/views/examples/tree_view_example.h" 5 #include "ui/views/examples/tree_view_example.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/views/controls/button/label_button.h" 8 #include "ui/views/controls/button/label_button.h"
9 #include "ui/views/controls/menu/menu_model_adapter.h" 9 #include "ui/views/controls/menu/menu_model_adapter.h"
10 #include "ui/views/controls/menu/menu_runner.h" 10 #include "ui/views/controls/menu/menu_runner.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 bool TreeViewExample::IsCommandIdChecked(int command_id) const { 148 bool TreeViewExample::IsCommandIdChecked(int command_id) const {
149 return false; 149 return false;
150 } 150 }
151 151
152 bool TreeViewExample::IsCommandIdEnabled(int command_id) const { 152 bool TreeViewExample::IsCommandIdEnabled(int command_id) const {
153 return const_cast<TreeViewExample*>(this)->IsCommandIdEnabled(command_id); 153 return const_cast<TreeViewExample*>(this)->IsCommandIdEnabled(command_id);
154 } 154 }
155 155
156 bool TreeViewExample::GetAcceleratorForCommandId(
157 int command_id,
158 ui::Accelerator* accelerator) const {
159 return false;
160 }
161
162 void TreeViewExample::ExecuteCommand(int command_id, int event_flags) { 156 void TreeViewExample::ExecuteCommand(int command_id, int event_flags) {
163 NodeType* selected_node = 157 NodeType* selected_node =
164 static_cast<NodeType*>(tree_view_->GetSelectedNode()); 158 static_cast<NodeType*>(tree_view_->GetSelectedNode());
165 switch (command_id) { 159 switch (command_id) {
166 case ID_EDIT: 160 case ID_EDIT:
167 tree_view_->StartEditing(selected_node); 161 tree_view_->StartEditing(selected_node);
168 break; 162 break;
169 case ID_REMOVE: 163 case ID_REMOVE:
170 model_.Remove(selected_node->parent(), selected_node); 164 model_.Remove(selected_node->parent(), selected_node);
171 break; 165 break;
172 case ID_ADD: 166 case ID_ADD:
173 AddNewNode(); 167 AddNewNode();
174 break; 168 break;
175 default: 169 default:
176 NOTREACHED(); 170 NOTREACHED();
177 } 171 }
178 } 172 }
179 173
180 } // namespace examples 174 } // namespace examples
181 } // namespace views 175 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/tree_view_example.h ('k') | ui/views/touchui/touch_selection_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698