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_BUBBLE_BUBBLE_DELEGATE_H_ | 5 #ifndef VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
6 #define VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 6 #define VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
10 #include "views/bubble/bubble_border.h" | 10 #include "views/bubble/bubble_border.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 // ui::AnimationDelegate overrides: | 69 // ui::AnimationDelegate overrides: |
70 virtual void AnimationEnded(const ui::Animation* animation); | 70 virtual void AnimationEnded(const ui::Animation* animation); |
71 virtual void AnimationProgressed(const ui::Animation* animation); | 71 virtual void AnimationProgressed(const ui::Animation* animation); |
72 | 72 |
73 const BubbleView* GetBubbleView() const; | 73 const BubbleView* GetBubbleView() const; |
74 const BubbleFrameView* GetBubbleFrameView() const; | 74 const BubbleFrameView* GetBubbleFrameView() const; |
75 | 75 |
76 // Get bubble bounds from the anchor point and client view's preferred size. | 76 // Get bubble bounds from the anchor point and client view's preferred size. |
77 gfx::Rect GetBubbleBounds(); | 77 gfx::Rect GetBubbleBounds(); |
78 | 78 |
79 // The widget hosting the border for this bubble. | |
80 Widget* border_widget_; | |
81 | |
79 // Fade animation for bubble. | 82 // Fade animation for bubble. |
80 scoped_ptr<ui::SlideAnimation> fade_animation_; | 83 scoped_ptr<ui::SlideAnimation> fade_animation_; |
81 | 84 |
82 // Should this bubble close on the escape key? | 85 // Should this bubble close on the escape key? |
83 bool close_on_esc_; | 86 bool close_on_esc_; |
84 | 87 |
85 // The screen point where this bubble's arrow is anchored. | 88 // The screen point where this bubble's arrow is anchored. |
86 gfx::Point anchor_point_; | 89 gfx::Point anchor_point_; |
87 | 90 |
88 // The arrow's location on the bubble. | 91 // The arrow's location on the bubble. |
89 BubbleBorder::ArrowLocation arrow_location_; | 92 BubbleBorder::ArrowLocation arrow_location_; |
90 | 93 |
91 // The background color of the bubble. | 94 // The background color of the bubble. |
92 SkColor color_; | 95 SkColor color_; |
93 }; | 96 }; |
94 | 97 |
98 // A separate delegate for the bubble's border widget. | |
99 class VIEWS_EXPORT BubbleBorderDelegateView : public WidgetDelegateView { | |
100 public: | |
101 explicit BubbleBorderDelegateView(BubbleDelegateView* bubble); | |
102 virtual ~BubbleBorderDelegateView(); | |
103 | |
104 // WidgetDelegateView overrides: | |
105 virtual View* GetContentsView() OVERRIDE; | |
106 virtual ClientView* CreateClientView(Widget* widget) OVERRIDE; | |
107 virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; | |
108 | |
109 private: | |
110 BubbleDelegateView* bubble_; | |
111 }; | |
Ben Goodger (Google)
2011/10/25 15:29:36
DISALLOW_COPY_..
msw
2011/10/27 02:01:45
Done.
| |
112 | |
95 } // namespace views | 113 } // namespace views |
96 | 114 |
97 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 115 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
OLD | NEW |