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 #include "views/bubble/bubble_delegate.h" | 5 #include "views/bubble/bubble_delegate.h" |
6 | 6 |
7 #include "ui/base/animation/slide_animation.h" | 7 #include "ui/base/animation/slide_animation.h" |
8 #include "views/bubble/bubble_frame_view.h" | 8 #include "views/bubble/bubble_frame_view.h" |
9 #include "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ClientView* BubbleDelegateView::CreateClientView(Widget* widget) { | 62 ClientView* BubbleDelegateView::CreateClientView(Widget* widget) { |
63 return new ClientView(widget, GetContentsView()); | 63 return new ClientView(widget, GetContentsView()); |
64 } | 64 } |
65 | 65 |
66 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView() { | 66 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView() { |
67 return new BubbleFrameView(GetArrowLocation(), | 67 return new BubbleFrameView(GetArrowLocation(), |
68 GetPreferredSize(), | 68 GetPreferredSize(), |
69 GetColor()); | 69 GetColor()); |
70 } | 70 } |
71 | 71 |
72 gfx::Point BubbleDelegateView::GetAnchorPoint() const { | 72 gfx::Point BubbleDelegateView::GetAnchorPoint() { |
73 return anchor_point_; | 73 return anchor_point_; |
74 } | 74 } |
75 | 75 |
76 BubbleBorder::ArrowLocation BubbleDelegateView::GetArrowLocation() const { | 76 BubbleBorder::ArrowLocation BubbleDelegateView::GetArrowLocation() const { |
77 return arrow_location_; | 77 return arrow_location_; |
78 } | 78 } |
79 | 79 |
80 SkColor BubbleDelegateView::GetColor() const { | 80 SkColor BubbleDelegateView::GetColor() const { |
81 return color_; | 81 return color_; |
82 } | 82 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 gfx::Rect BubbleDelegateView::GetBubbleBounds() { | 132 gfx::Rect BubbleDelegateView::GetBubbleBounds() { |
133 // The argument rect has its origin at the bubble's arrow anchor point; | 133 // The argument rect has its origin at the bubble's arrow anchor point; |
134 // its size is the preferred size of the bubble's client view (this view). | 134 // its size is the preferred size of the bubble's client view (this view). |
135 return GetBubbleFrameView()->GetWindowBoundsForClientBounds( | 135 return GetBubbleFrameView()->GetWindowBoundsForClientBounds( |
136 gfx::Rect(GetAnchorPoint(), GetPreferredSize())); | 136 gfx::Rect(GetAnchorPoint(), GetPreferredSize())); |
137 } | 137 } |
138 | 138 |
139 } // namespace views | 139 } // namespace views |
OLD | NEW |