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

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

Issue 167643003: Support prefix typing in Combobox while menu is open (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retry upload Created 6 years, 10 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 | « no previous file | ui/views/controls/menu/menu_controller.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 #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 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #include <list> 10 #include <list>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // An alternative to Cancel(EXIT_ALL) that can be used with a OneShotTimer. 94 // An alternative to Cancel(EXIT_ALL) that can be used with a OneShotTimer.
95 void CancelAll() { Cancel(EXIT_ALL); } 95 void CancelAll() { Cancel(EXIT_ALL); }
96 96
97 // Returns the current exit type. This returns a value other than EXIT_NONE if 97 // Returns the current exit type. This returns a value other than EXIT_NONE if
98 // the menu is being canceled. 98 // the menu is being canceled.
99 ExitType exit_type() const { return exit_type_; } 99 ExitType exit_type() const { return exit_type_; }
100 100
101 // Returns the time from the event which closed the menu - or 0. 101 // Returns the time from the event which closed the menu - or 0.
102 base::TimeDelta closing_event_time() const { return closing_event_time_; } 102 base::TimeDelta closing_event_time() const { return closing_event_time_; }
103 103
104 void set_accept_on_f4(bool accept_on_f4) { accept_on_f4_ = accept_on_f4; } 104 void set_is_combobox(bool is_combobox) { is_combobox_ = is_combobox; }
105 105
106 // Various events, forwarded from the submenu. 106 // Various events, forwarded from the submenu.
107 // 107 //
108 // NOTE: the coordinates of the events are in that of the 108 // NOTE: the coordinates of the events are in that of the
109 // MenuScrollViewContainer. 109 // MenuScrollViewContainer.
110 void OnMousePressed(SubmenuView* source, const ui::MouseEvent& event); 110 void OnMousePressed(SubmenuView* source, const ui::MouseEvent& event);
111 void OnMouseDragged(SubmenuView* source, const ui::MouseEvent& event); 111 void OnMouseDragged(SubmenuView* source, const ui::MouseEvent& event);
112 void OnMouseReleased(SubmenuView* source, const ui::MouseEvent& event); 112 void OnMouseReleased(SubmenuView* source, const ui::MouseEvent& event);
113 void OnMouseMoved(SubmenuView* source, const ui::MouseEvent& event); 113 void OnMouseMoved(SubmenuView* source, const ui::MouseEvent& event);
114 void OnMouseEntered(SubmenuView* source, const ui::MouseEvent& event); 114 void OnMouseEntered(SubmenuView* source, const ui::MouseEvent& event);
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 // The timestamp of the event which closed the menu - or 0 otherwise. 575 // The timestamp of the event which closed the menu - or 0 otherwise.
576 base::TimeDelta closing_event_time_; 576 base::TimeDelta closing_event_time_;
577 577
578 // Time when the menu is first shown. 578 // Time when the menu is first shown.
579 base::TimeTicks menu_start_time_; 579 base::TimeTicks menu_start_time_;
580 580
581 // If a mouse press triggered this menu, this will have its location (in 581 // If a mouse press triggered this menu, this will have its location (in
582 // screen coordinates). Otherwise this will be (0, 0). 582 // screen coordinates). Otherwise this will be (0, 0).
583 gfx::Point menu_start_mouse_press_loc_; 583 gfx::Point menu_start_mouse_press_loc_;
584 584
585 // Whether the menu should accept on F4, like Windows native Combobox menus. 585 // Controls behavior differences between a combobox and other types of menu
586 bool accept_on_f4_; 586 // (like a context menu).
587 bool is_combobox_;
587 588
588 // Set to true if the menu item was selected by touch. 589 // Set to true if the menu item was selected by touch.
589 bool item_selected_by_touch_; 590 bool item_selected_by_touch_;
590 591
591 DISALLOW_COPY_AND_ASSIGN(MenuController); 592 DISALLOW_COPY_AND_ASSIGN(MenuController);
592 }; 593 };
593 594
594 } // namespace views 595 } // namespace views
595 596
596 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 597 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698