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

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

Issue 9968058: Cleanup: remove GTK stuff (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 | « chrome/common/chrome_switches.cc ('k') | ui/views/controls/native/native_view_host.cc » ('j') | 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 menu_->GetDelegate()->ExecuteCommand(result->GetCommand(), 233 menu_->GetDelegate()->ExecuteCommand(result->GetCommand(),
234 mouse_event_flags); 234 mouse_event_flags);
235 } 235 }
236 return MenuRunner::NORMAL_EXIT; 236 return MenuRunner::NORMAL_EXIT;
237 } 237 }
238 238
239 bool MenuRunnerImpl::ShouldShowMnemonics(MenuButton* button) { 239 bool MenuRunnerImpl::ShouldShowMnemonics(MenuButton* button) {
240 // Show mnemonics if the button has focus or alt is pressed. 240 // Show mnemonics if the button has focus or alt is pressed.
241 bool show_mnemonics = button ? button->HasFocus() : false; 241 bool show_mnemonics = button ? button->HasFocus() : false;
242 #if defined(OS_WIN) 242 #if defined(OS_WIN)
243 // We don't currently need this on gtk as showing the menu gives focus to the 243 // This is only needed on Windows.
244 // button first.
245 if (!show_mnemonics) 244 if (!show_mnemonics)
246 show_mnemonics = base::win::IsAltPressed(); 245 show_mnemonics = base::win::IsAltPressed();
247 #endif 246 #endif
248 return show_mnemonics; 247 return show_mnemonics;
249 } 248 }
250 249
251 } // namespace internal 250 } // namespace internal
252 251
253 MenuRunner::MenuRunner(MenuItemView* menu) 252 MenuRunner::MenuRunner(MenuItemView* menu)
254 : holder_(new internal::MenuRunnerImpl(menu)) { 253 : holder_(new internal::MenuRunnerImpl(menu)) {
(...skipping 17 matching lines...) Expand all
272 271
273 bool MenuRunner::IsRunning() const { 272 bool MenuRunner::IsRunning() const {
274 return holder_->running(); 273 return holder_->running();
275 } 274 }
276 275
277 void MenuRunner::Cancel() { 276 void MenuRunner::Cancel() {
278 holder_->Cancel(); 277 holder_->Cancel();
279 } 278 }
280 279
281 } // namespace views 280 } // namespace views
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | ui/views/controls/native/native_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698