| OLD | NEW |
| 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 VIEWS_EXAMPLES_BUBBLE_EXAMPLE_H_ | 5 #ifndef VIEWS_EXAMPLES_BUBBLE_EXAMPLE_H_ |
| 6 #define VIEWS_EXAMPLES_BUBBLE_EXAMPLE_H_ | 6 #define VIEWS_EXAMPLES_BUBBLE_EXAMPLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "ui/base/animation/animation_delegate.h" | |
| 14 #include "views/controls/button/text_button.h" | |
| 15 #include "views/examples/example_base.h" | 9 #include "views/examples/example_base.h" |
| 16 #include "views/layout/box_layout.h" | 10 #include "views/controls/button/button.h" |
| 17 #include "views/layout/grid_layout.h" | |
| 18 #include "views/widget/widget.h" | |
| 19 | |
| 20 namespace views { | |
| 21 class BubbleDelegateView; | |
| 22 class Button; | |
| 23 class ColumnSet; | |
| 24 } // namespace views | |
| 25 | 11 |
| 26 namespace examples { | 12 namespace examples { |
| 13 |
| 27 struct BubbleConfig; | 14 struct BubbleConfig; |
| 28 | 15 |
| 29 // A Bubble example. | 16 // A Bubble example. |
| 30 class BubbleExample : public ExampleBase, | 17 class BubbleExample : public ExampleBase, |
| 31 public ui::AnimationDelegate, | |
| 32 public views::ButtonListener { | 18 public views::ButtonListener { |
| 33 public: | 19 public: |
| 34 explicit BubbleExample(ExamplesMain* main); | 20 explicit BubbleExample(ExamplesMain* main); |
| 35 virtual ~BubbleExample(); | 21 virtual ~BubbleExample(); |
| 36 | 22 |
| 37 // Overridden from ExampleBase. | 23 // Overridden from ExampleBase. |
| 38 virtual void CreateExampleView(views::View* container) OVERRIDE; | 24 virtual void CreateExampleView(views::View* container) OVERRIDE; |
| 39 | 25 |
| 40 private: | 26 private: |
| 41 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; | |
| 42 | |
| 43 virtual void ButtonPressed(views::Button* sender, | 27 virtual void ButtonPressed(views::Button* sender, |
| 44 const views::Event& event) OVERRIDE; | 28 const views::Event& event) OVERRIDE; |
| 45 | 29 |
| 46 // Add a bubble view in the example | |
| 47 views::Widget* AddBubbleButton(const BubbleConfig& config); | |
| 48 | |
| 49 views::Button* round_; | 30 views::Button* round_; |
| 50 views::Button* pointy_; | 31 views::Button* arrow_; |
| 51 views::Button* fade_; | 32 views::Button* fade_in_; |
| 52 views::BoxLayout* layout_; | 33 views::Button* fade_out_; |
| 53 | |
| 54 views::Widget* round_bubble_; | |
| 55 views::Widget* pointy_bubble_; | |
| 56 views::Widget* fade_bubble_; | |
| 57 | 34 |
| 58 DISALLOW_COPY_AND_ASSIGN(BubbleExample); | 35 DISALLOW_COPY_AND_ASSIGN(BubbleExample); |
| 59 }; | 36 }; |
| 60 | 37 |
| 61 } // namespace examples | 38 } // namespace examples |
| 62 | 39 |
| 63 #endif // VIEWS_EXAMPLES_BUBBLE_EXAMPLE_H_ | 40 #endif // VIEWS_EXAMPLES_BUBBLE_EXAMPLE_H_ |
| OLD | NEW |