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

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

Issue 2689363004: [Payments] Add combobox support to editors. (Closed)
Patch Set: re-enable test, addressed comments Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | 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 a7a7cae22c7d75bed42ea373efca83797e772461..c06ddb9a3880743d4b3af3f388a9de6af40ec366 100644
--- a/ui/views/controls/combobox/combobox.h
+++ b/ui/views/controls/combobox/combobox.h
@@ -9,6 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "base/time/time.h"
+#include "ui/base/models/combobox_model.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/prefix_delegate.h"
@@ -17,7 +18,6 @@ class FontList;
}
namespace ui {
-class ComboboxModel;
class MenuModel;
}
@@ -56,7 +56,10 @@ class VIEWS_EXPORT Combobox : public View,
// The combobox's class name.
static const char kViewClassName[];
- // |model| is not owned by the combobox.
+ // |model| is owned by the combobox when using this constructor.
+ explicit Combobox(std::unique_ptr<ui::ComboboxModel> model,
+ Style style = STYLE_NORMAL);
+ // |model| is not owned by the combobox when using this constructor.
explicit Combobox(ui::ComboboxModel* model, Style style = STYLE_NORMAL);
~Combobox() override;
@@ -159,7 +162,11 @@ class VIEWS_EXPORT Combobox : public View,
// Returns the width of the combobox's arrow container.
int GetArrowContainerWidth() const;
- // Our model. Not owned.
+ // Optionally used to tie the lifetime of the model to this combobox. See
+ // constructor.
+ std::unique_ptr<ui::ComboboxModel> owned_model_;
+
+ // Reference to our model, which may be owned or not.
ui::ComboboxModel* model_;
// The visual style of this combobox.
« no previous file with comments | « chrome/test/BUILD.gn ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698