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

Side by Side Diff: ui/views/examples/text_example.h

Issue 8607001: views: Factor out Listener from Combobox into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sky review Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/examples/native_theme_button_example.cc ('k') | ui/views/examples/text_example.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ 5 #ifndef UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_
6 #define UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ 6 #define UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "ui/views/examples/example_base.h" 11 #include "ui/views/examples/example_base.h"
12 #include "views/controls/button/button.h" 12 #include "views/controls/button/button.h"
13 #include "views/controls/combobox/combobox.h" 13 #include "views/controls/combobox/combobox_listener.h"
14 14
15 namespace views { 15 namespace views {
16 class Checkbox; 16 class Checkbox;
17 class GridLayout; 17 class GridLayout;
18 } 18 }
19 19
20 namespace examples { 20 namespace examples {
21 21
22 class TextExample : public ExampleBase, 22 class TextExample : public ExampleBase,
23 public views::ButtonListener, 23 public views::ButtonListener,
24 public views::Combobox::Listener { 24 public views::ComboboxListener {
25 public: 25 public:
26 explicit TextExample(ExamplesMain* main); 26 explicit TextExample(ExamplesMain* main);
27 virtual ~TextExample(); 27 virtual ~TextExample();
28 28
29 // Overridden from ExampleBase: 29 // Overridden from ExampleBase:
30 virtual void CreateExampleView(views::View* container) OVERRIDE; 30 virtual void CreateExampleView(views::View* container) OVERRIDE;
31 31
32 private: 32 private:
33 // Create and add a combo box to the layout. 33 // Create and add a combo box to the layout.
34 views::Combobox* AddCombobox(views::GridLayout* layout, 34 views::Combobox* AddCombobox(views::GridLayout* layout,
35 const char* name, 35 const char* name,
36 const char** strings, 36 const char** strings,
37 int count); 37 int count);
38 38
39 // Overridden from views::ButtonListener: 39 // Overridden from views::ButtonListener:
40 virtual void ButtonPressed(views::Button* button, 40 virtual void ButtonPressed(views::Button* button,
41 const views::Event& event) OVERRIDE; 41 const views::Event& event) OVERRIDE;
42 42
43 // Overridden from views::Combobox::Listener: 43 // Overridden from views::ComboboxListener:
44 virtual void ItemChanged(views::Combobox* combo_box, 44 virtual void ItemChanged(views::Combobox* combo_box,
45 int prev_index, 45 int prev_index,
46 int new_index) OVERRIDE; 46 int new_index) OVERRIDE;
47 47
48 48
49 class TextExampleView; 49 class TextExampleView;
50 // The content of the scroll view. 50 // The content of the scroll view.
51 TextExampleView* text_view_; 51 TextExampleView* text_view_;
52 52
53 // Combo box for horizontal text alignment. 53 // Combo box for horizontal text alignment.
(...skipping 16 matching lines...) Expand all
70 70
71 // Check box to enable/disable character break behavior. 71 // Check box to enable/disable character break behavior.
72 views::Checkbox* break_checkbox_; 72 views::Checkbox* break_checkbox_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(TextExample); 74 DISALLOW_COPY_AND_ASSIGN(TextExample);
75 }; 75 };
76 76
77 } // namespace examples 77 } // namespace examples
78 78
79 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_ 79 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_
OLDNEW
« no previous file with comments | « ui/views/examples/native_theme_button_example.cc ('k') | ui/views/examples/text_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698