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

Unified Diff: ui/views/controls/combobox/combobox.h

Issue 2264403006: Update ui/views menus to use async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Updates Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox.h
diff --git a/ui/views/controls/combobox/combobox.h b/ui/views/controls/combobox/combobox.h
index 5cd44549de00c5b340a73098ad130a72dd216625..3de7dc7d880798675fb7c15c307253bc30b74b43 100644
--- a/ui/views/controls/combobox/combobox.h
+++ b/ui/views/controls/combobox/combobox.h
@@ -28,6 +28,7 @@ class ComboboxTestApi;
class ComboboxListener;
class CustomButton;
+class MenuModelAdapter;
class MenuRunner;
class Painter;
class PrefixSelector;
@@ -113,7 +114,7 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
private:
friend class test::ComboboxTestApi;
- class ComboboxMenuModelAdapter;
+ class ComboboxMenuModel;
// Updates the border according to the current state.
void UpdateBorder();
@@ -130,6 +131,9 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
// Show the drop down list
void ShowDropDownMenu(ui::MenuSourceType source_type);
+ // Cleans up after the menu as closed
+ void OnMenuClosed(Button::ButtonState original_button_state);
+
// Called when the selection is changed by the user.
void OnPerformAction();
@@ -172,8 +176,8 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
// A helper used to select entries by keyboard input.
std::unique_ptr<PrefixSelector> selector_;
- // Adapts a ComboboxModel for use by a views MenuRunner.
- std::unique_ptr<ui::MenuModel> menu_model_adapter_;
+ // The ComboboxModel for use by |menu_runner_|.
+ std::unique_ptr<ui::MenuModel> menu_model_;
// Like MenuButton, we use a time object in order to keep track of when the
// combobox was closed. The time is used for simulating menu behavior; that
@@ -204,7 +208,8 @@ class VIEWS_EXPORT Combobox : public PrefixDelegate, public ButtonListener {
// Set while the dropdown is showing. Ensures the menu is closed if |this| is
// destroyed.
- std::unique_ptr<views::MenuRunner> menu_runner_;
+ std::unique_ptr<MenuModelAdapter> menu_model_adapter_;
+ std::unique_ptr<MenuRunner> menu_runner_;
// The image to be drawn for this combobox's arrow.
gfx::ImageSkia arrow_image_;
« no previous file with comments | « no previous file | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698