diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 17:22:48 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 17:22:48 +0000 |
commit | e557d64b1d89a5acbe4b185e63c029c428bd217b (patch) | |
tree | adc254b279329bfae6f1a53cc19a03a3cade7a41 /views/examples/combobox_example.h | |
parent | dd92c8dc5191650d37501f74bf017e4ad4f664a4 (diff) | |
download | chromium_src-e557d64b1d89a5acbe4b185e63c029c428bd217b.zip chromium_src-e557d64b1d89a5acbe4b185e63c029c428bd217b.tar.gz chromium_src-e557d64b1d89a5acbe4b185e63c029c428bd217b.tar.bz2 |
Porting the view examples to Windows.
Some refactoring done to the tests also.
See original review at:
http://codereview.chromium.org/295013/show
BUG=None
TEST=Make sure the view examples build and run on Windows
and Linux.
Review URL: http://codereview.chromium.org/294026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/examples/combobox_example.h')
-rw-r--r-- | views/examples/combobox_example.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/views/examples/combobox_example.h b/views/examples/combobox_example.h index 28c8cc3..f65508f 100644 --- a/views/examples/combobox_example.h +++ b/views/examples/combobox_example.h @@ -13,17 +13,22 @@ namespace examples { // ComboboxExample -class ComboboxExample : protected ExampleBase, - private views::Combobox::Listener { +class ComboboxExample : public ExampleBase, public views::Combobox::Listener { public: - ComboboxExample(views::TabbedPane* tabbed_pane, views::Label* message) - : ExampleBase(message) { - views::Combobox* cb = new views::Combobox(new ComboboxModelExample()); - cb->set_listener(this); - tabbed_pane->AddTab(L"Combo Box", cb); + explicit ComboboxExample(ExamplesMain* main) : ExampleBase(main) { + combobox_ = new views::Combobox(new ComboboxModelExample()); + combobox_->set_listener(this); } virtual ~ComboboxExample() {} + virtual std::wstring GetExampleTitle() { + return L"Combo Box"; + } + + virtual views::View* GetExampleView() { + return combobox_; + } + private: // An sample combobox model that generates list of "Item <index>". class ComboboxModelExample : public ComboboxModel { @@ -51,6 +56,9 @@ class ComboboxExample : protected ExampleBase, new_index, combo_box->model()->GetItemAt(new_index).c_str()); } + // This test only control. + views::Combobox* combobox_; + DISALLOW_COPY_AND_ASSIGN(ComboboxExample); }; |