Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / views / examples / combobox_example.h
blob89ccff2e986b74f83e38fd89b2d6d802af8d8701
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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_EXAMPLES_COMBOBOX_EXAMPLE_H_
6 #define UI_VIEWS_EXAMPLES_COMBOBOX_EXAMPLE_H_
8 #include "base/macros.h"
9 #include "ui/base/models/combobox_model.h"
10 #include "ui/views/controls/combobox/combobox_listener.h"
11 #include "ui/views/examples/example_base.h"
13 namespace views {
14 namespace examples {
16 // A combobox model implementation that generates a list of "Item <index>".
17 class VIEWS_EXAMPLES_EXPORT ComboboxModelExample : public ui::ComboboxModel {
18 public:
19 ComboboxModelExample();
20 virtual ~ComboboxModelExample();
22 // ui::ComboboxModel:
23 virtual int GetItemCount() const OVERRIDE;
24 virtual base::string16 GetItemAt(int index) OVERRIDE;
26 private:
27 DISALLOW_COPY_AND_ASSIGN(ComboboxModelExample);
30 class VIEWS_EXAMPLES_EXPORT ComboboxExample : public ExampleBase,
31 public ComboboxListener {
32 public:
33 ComboboxExample();
34 virtual ~ComboboxExample();
36 // ExampleBase:
37 virtual void CreateExampleView(View* container) OVERRIDE;
39 private:
40 // ComboboxListener:
41 virtual void OnPerformAction(Combobox* combobox) OVERRIDE;
43 ComboboxModelExample combobox_model_;
44 Combobox* combobox_;
46 DISALLOW_COPY_AND_ASSIGN(ComboboxExample);
49 } // namespace examples
50 } // namespace views
52 #endif // UI_VIEWS_EXAMPLES_COMBOBOX_EXAMPLE_H_