OLD | NEW |
1 // Copyright (c) 2009 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 VIEWS_EXAMPLES_BUTTON_EXAMPLE_H_ | 5 #ifndef VIEWS_EXAMPLES_BUTTON_EXAMPLE_H_ |
6 #define VIEWS_EXAMPLES_BUTTON_EXAMPLE_H_ | 6 #define VIEWS_EXAMPLES_BUTTON_EXAMPLE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "views/controls/button/text_button.h" | 10 #include "views/controls/button/text_button.h" |
11 #include "views/examples/example_base.h" | 11 #include "views/examples/example_base.h" |
12 #include "views/fill_layout.h" | 12 #include "views/layout/fill_layout.h" |
13 #include "views/view.h" | 13 #include "views/view.h" |
14 | 14 |
15 namespace examples { | 15 namespace examples { |
16 | 16 |
17 // ButtonExample simply counts the number of clicks. | 17 // ButtonExample simply counts the number of clicks. |
18 class ButtonExample : public ExampleBase, public views::ButtonListener { | 18 class ButtonExample : public ExampleBase, public views::ButtonListener { |
19 public: | 19 public: |
20 explicit ButtonExample(ExamplesMain* main) : ExampleBase(main), count_(0) { | 20 explicit ButtonExample(ExamplesMain* main) : ExampleBase(main), count_(0) { |
21 button_ = new views::TextButton(this, L"Button"); | 21 button_ = new views::TextButton(this, L"Button"); |
22 } | 22 } |
(...skipping 20 matching lines...) Expand all Loading... |
43 | 43 |
44 // The number of times the button is pressed. | 44 // The number of times the button is pressed. |
45 int count_; | 45 int count_; |
46 | 46 |
47 DISALLOW_COPY_AND_ASSIGN(ButtonExample); | 47 DISALLOW_COPY_AND_ASSIGN(ButtonExample); |
48 }; | 48 }; |
49 | 49 |
50 } // namespace examples | 50 } // namespace examples |
51 | 51 |
52 #endif // VIEWS_EXAMPLES_BUTTON_EXAMPLE_H_ | 52 #endif // VIEWS_EXAMPLES_BUTTON_EXAMPLE_H_ |
53 | |
OLD | NEW |