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

Side by Side Diff: ui/views/controls/menu/menu_controller.h

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync 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
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 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Internally this updates pending_state_ immediatley. state_ is only updated 231 // Internally this updates pending_state_ immediatley. state_ is only updated
232 // immediately if SELECTION_UPDATE_IMMEDIATELY is set. If 232 // immediately if SELECTION_UPDATE_IMMEDIATELY is set. If
233 // SELECTION_UPDATE_IMMEDIATELY is not set CommitPendingSelection is invoked 233 // SELECTION_UPDATE_IMMEDIATELY is not set CommitPendingSelection is invoked
234 // to show/hide submenus and update state_. 234 // to show/hide submenus and update state_.
235 void SetSelection(MenuItemView* menu_item, int types); 235 void SetSelection(MenuItemView* menu_item, int types);
236 236
237 void SetSelectionOnPointerDown(SubmenuView* source, 237 void SetSelectionOnPointerDown(SubmenuView* source,
238 const LocatedEvent& event); 238 const LocatedEvent& event);
239 void StartDrag(SubmenuView* source, const gfx::Point& location); 239 void StartDrag(SubmenuView* source, const gfx::Point& location);
240 240
241 #if defined(OS_WIN) 241 #if defined(OS_WIN) || defined(USE_AURA)
242 // Dispatcher method. This returns true if the menu was canceled, or 242 // Dispatcher method. This returns true if the menu was canceled, or
243 // if the message is such that the menu should be closed. 243 // if the message is such that the menu should be closed.
244 virtual bool Dispatch(const MSG& msg) OVERRIDE; 244 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
245 #elif defined(USE_WAYLAND) 245 #elif defined(USE_WAYLAND)
246 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( 246 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch(
247 base::wayland::WaylandEvent* event) OVERRIDE; 247 base::wayland::WaylandEvent* event) OVERRIDE;
248 #elif defined(USE_AURA)
249 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch(
250 XEvent* xevent) OVERRIDE;
251 #endif 248 #endif
252 249
253 // Key processing. The return value of this is returned from Dispatch. 250 // Key processing. The return value of this is returned from Dispatch.
254 // In other words, if this returns false (which happens if escape was 251 // In other words, if this returns false (which happens if escape was
255 // pressed, or a matching mnemonic was found) the message loop returns. 252 // pressed, or a matching mnemonic was found) the message loop returns.
256 bool OnKeyDown(ui::KeyboardCode key_code); 253 bool OnKeyDown(ui::KeyboardCode key_code);
257 254
258 // Creates a MenuController. If |blocking| is true a nested message loop is 255 // Creates a MenuController. If |blocking| is true a nested message loop is
259 // started in |Run|. 256 // started in |Run|.
260 MenuController(bool blocking, internal::MenuControllerDelegate* delegate); 257 MenuController(bool blocking, internal::MenuControllerDelegate* delegate);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 View* active_mouse_view_; 527 View* active_mouse_view_;
531 528
532 internal::MenuControllerDelegate* delegate_; 529 internal::MenuControllerDelegate* delegate_;
533 530
534 DISALLOW_COPY_AND_ASSIGN(MenuController); 531 DISALLOW_COPY_AND_ASSIGN(MenuController);
535 }; 532 };
536 533
537 } // namespace views 534 } // namespace views
538 535
539 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 536 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698