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 "views/bubble/bubble_frame_view.h" | 7 #include "views/bubble/bubble_frame_view.h" |
8 #include "views/bubble/bubble_view.h" | 8 #include "views/bubble/bubble_view.h" |
9 #include "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... | |
39 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView() { | 39 NonClientFrameView* BubbleDelegateView::CreateNonClientFrameView() { |
40 return new BubbleFrameView(GetArrowLocation(), | 40 return new BubbleFrameView(GetArrowLocation(), |
41 GetPreferredSize(), | 41 GetPreferredSize(), |
42 GetColor()); | 42 GetColor()); |
43 } | 43 } |
44 | 44 |
45 gfx::Point BubbleDelegateView::GetAnchorPoint() const { | 45 gfx::Point BubbleDelegateView::GetAnchorPoint() const { |
46 return gfx::Point(); | 46 return gfx::Point(); |
47 } | 47 } |
48 | 48 |
49 views::View* BubbleDelegateView::GetInitiallyFocusedView() { | |
50 return this; | |
msw
2011/10/20 19:17:50
already done, will land soon :)
| |
51 } | |
52 | |
49 BubbleBorder::ArrowLocation BubbleDelegateView::GetArrowLocation() const { | 53 BubbleBorder::ArrowLocation BubbleDelegateView::GetArrowLocation() const { |
50 return BubbleBorder::TOP_LEFT; | 54 return BubbleBorder::TOP_LEFT; |
51 } | 55 } |
52 | 56 |
53 SkColor BubbleDelegateView::GetColor() const { | 57 SkColor BubbleDelegateView::GetColor() const { |
54 return SK_ColorWHITE; | 58 return SK_ColorWHITE; |
55 } | 59 } |
56 | 60 |
57 void BubbleDelegateView::Init() {} | 61 void BubbleDelegateView::Init() {} |
58 | 62 |
59 const BubbleView* BubbleDelegateView::GetBubbleView() const { | 63 const BubbleView* BubbleDelegateView::GetBubbleView() const { |
60 return GetWidget()->client_view()->AsBubbleView(); | 64 return GetWidget()->client_view()->AsBubbleView(); |
61 } | 65 } |
62 | 66 |
63 const BubbleFrameView* BubbleDelegateView::GetBubbleFrameView() const { | 67 const BubbleFrameView* BubbleDelegateView::GetBubbleFrameView() const { |
64 return static_cast<BubbleFrameView*>( | 68 return static_cast<BubbleFrameView*>( |
65 GetWidget()->non_client_view()->frame_view()); | 69 GetWidget()->non_client_view()->frame_view()); |
66 } | 70 } |
67 | 71 |
68 gfx::Rect BubbleDelegateView::GetBubbleBounds() { | 72 gfx::Rect BubbleDelegateView::GetBubbleBounds() { |
69 // The argument rect has its origin at the bubble's arrow anchor point; | 73 // The argument rect has its origin at the bubble's arrow anchor point; |
70 // its size is the preferred size of the bubble's client view (this view). | 74 // its size is the preferred size of the bubble's client view (this view). |
71 return GetBubbleFrameView()->GetWindowBoundsForClientBounds( | 75 return GetBubbleFrameView()->GetWindowBoundsForClientBounds( |
72 gfx::Rect(GetAnchorPoint(), GetPreferredSize())); | 76 gfx::Rect(GetAnchorPoint(), GetPreferredSize())); |
73 } | 77 } |
74 | 78 |
75 } // namespace views | 79 } // namespace views |
OLD | NEW |