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

Side by Side Diff: ui/views/controls/menu/menu_runner.cc

Issue 10832360: Change to address default selection of menu item (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: type check 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/controls/menu/menu_runner.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/controls/menu/menu_runner.h" 5 #include "ui/views/controls/menu/menu_runner.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "ui/views/controls/button/menu_button.h" 9 #include "ui/views/controls/button/menu_button.h"
10 #include "ui/views/controls/menu/menu_controller.h" 10 #include "ui/views/controls/menu/menu_controller.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (!controller) { 167 if (!controller) {
168 // No menus are showing, show one. 168 // No menus are showing, show one.
169 controller = new MenuController(!for_drop_, this); 169 controller = new MenuController(!for_drop_, this);
170 owns_controller_ = true; 170 owns_controller_ = true;
171 } 171 }
172 controller_ = controller; 172 controller_ = controller;
173 menu_->set_controller(controller_); 173 menu_->set_controller(controller_);
174 174
175 // Run the loop. 175 // Run the loop.
176 MenuItemView* result = controller->Run(parent, button, menu_, bounds, anchor, 176 MenuItemView* result = controller->Run(parent, button, menu_, bounds, anchor,
177 (types & MenuRunner::CONTEXT_MENU) != 0,
177 &mouse_event_flags); 178 &mouse_event_flags);
178 179
179 if (for_drop_) { 180 if (for_drop_) {
180 // Drop menus return immediately. We finish processing in DropMenuClosed. 181 // Drop menus return immediately. We finish processing in DropMenuClosed.
181 return MenuRunner::NORMAL_EXIT; 182 return MenuRunner::NORMAL_EXIT;
182 } 183 }
183 184
184 return MenuDone(result, mouse_event_flags); 185 return MenuDone(result, mouse_event_flags);
185 } 186 }
186 187
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 289
289 bool MenuRunner::IsRunning() const { 290 bool MenuRunner::IsRunning() const {
290 return holder_->running(); 291 return holder_->running();
291 } 292 }
292 293
293 void MenuRunner::Cancel() { 294 void MenuRunner::Cancel() {
294 holder_->Cancel(); 295 holder_->Cancel();
295 } 296 }
296 297
297 } // namespace views 298 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698