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

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

Issue 10824016: views/examples: Pure pedantic change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/examples/textfield_example.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/views/controls/menu/menu_model_adapter.h" 8 #include "ui/views/controls/menu/menu_model_adapter.h"
9 #include "ui/views/controls/menu/menu_runner.h" 9 #include "ui/views/controls/menu/menu_runner.h"
10 #include "ui/views/controls/tree/tree_view.h" 10 #include "ui/views/controls/tree/tree_view.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 ui::TreeModelNode* node) { 121 ui::TreeModelNode* node) {
122 return true; 122 return true;
123 } 123 }
124 124
125 void TreeViewExample::ShowContextMenuForView(View* source, 125 void TreeViewExample::ShowContextMenuForView(View* source,
126 const gfx::Point& point) { 126 const gfx::Point& point) {
127 ui::SimpleMenuModel context_menu_model(this); 127 ui::SimpleMenuModel context_menu_model(this);
128 context_menu_model.AddItem(ID_EDIT, ASCIIToUTF16("Edit")); 128 context_menu_model.AddItem(ID_EDIT, ASCIIToUTF16("Edit"));
129 context_menu_model.AddItem(ID_REMOVE, ASCIIToUTF16("Remove")); 129 context_menu_model.AddItem(ID_REMOVE, ASCIIToUTF16("Remove"));
130 context_menu_model.AddItem(ID_ADD, ASCIIToUTF16("Add")); 130 context_menu_model.AddItem(ID_ADD, ASCIIToUTF16("Add"));
131 views::MenuModelAdapter menu_adapter(&context_menu_model); 131 MenuModelAdapter menu_adapter(&context_menu_model);
132 context_menu_runner_.reset(new views::MenuRunner(menu_adapter.CreateMenu())); 132 context_menu_runner_.reset(new MenuRunner(menu_adapter.CreateMenu()));
133 if (context_menu_runner_->RunMenuAt(source->GetWidget(), NULL, 133 if (context_menu_runner_->RunMenuAt(source->GetWidget(), NULL,
134 gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT, 0) == 134 gfx::Rect(point, gfx::Size()), MenuItemView::TOPLEFT, 0) ==
135 views::MenuRunner::MENU_DELETED) 135 MenuRunner::MENU_DELETED)
136 return; 136 return;
137 } 137 }
138 138
139 bool TreeViewExample::IsCommandIdChecked(int command_id) const { 139 bool TreeViewExample::IsCommandIdChecked(int command_id) const {
140 return false; 140 return false;
141 } 141 }
142 142
143 bool TreeViewExample::IsCommandIdEnabled(int command_id) const { 143 bool TreeViewExample::IsCommandIdEnabled(int command_id) const {
144 return const_cast<TreeViewExample*>(this)->IsCommandIdEnabled(command_id); 144 return const_cast<TreeViewExample*>(this)->IsCommandIdEnabled(command_id);
145 } 145 }
(...skipping 17 matching lines...) Expand all
163 case ID_ADD: 163 case ID_ADD:
164 AddNewNode(); 164 AddNewNode();
165 break; 165 break;
166 default: 166 default:
167 NOTREACHED(); 167 NOTREACHED();
168 } 168 }
169 } 169 }
170 170
171 } // namespace examples 171 } // namespace examples
172 } // namespace views 172 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/textfield_example.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698