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_LABEL_EXAMPLE_H_
6 #define UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_
8 #include "base/macros.h"
9 #include "ui/views/controls/button/button.h"
10 #include "ui/views/controls/combobox/combobox_listener.h"
11 #include "ui/views/controls/textfield/textfield_controller.h"
12 #include "ui/views/examples/example_base.h"
22 class ExampleComboboxModel
;
24 class VIEWS_EXAMPLES_EXPORT LabelExample
: public ExampleBase
,
25 public ButtonListener
,
26 public ComboboxListener
,
27 public TextfieldController
{
30 ~LabelExample() override
;
33 void CreateExampleView(View
* container
) override
;
36 void ButtonPressed(Button
* button
, const ui::Event
& event
) override
;
39 void OnPerformAction(Combobox
* combobox
) override
;
41 // TextfieldController:
42 void ContentsChanged(Textfield
* sender
,
43 const base::string16
& new_contents
) override
;
46 // Add a customizable label and various controls to modify its presentation.
47 void AddCustomLabel(View
* container
);
49 // Creates and adds a combobox to the layout.
50 Combobox
* AddCombobox(GridLayout
* layout
,
55 Textfield
* textfield_
;
57 Combobox
* elide_behavior_
;
58 ScopedVector
<ExampleComboboxModel
> example_combobox_models_
;
63 DISALLOW_COPY_AND_ASSIGN(LabelExample
);
66 } // namespace examples
69 #endif // UI_VIEWS_EXAMPLES_LABEL_EXAMPLE_H_