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 "views/bubble/bubble_border.h" | 9 #include "views/bubble/bubble_border.h" |
10 #include "views/widget/widget_delegate.h" | 10 #include "views/widget/widget_delegate.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 | 13 |
14 class BubbleFrameView; | 14 class BubbleFrameView; |
15 class BubbleView; | 15 class BubbleView; |
16 | 16 |
17 // BubbleDelegateView creates frame and client views for bubble Widgets. | 17 // BubbleDelegateView creates frame and client views for bubble Widgets. |
18 // BubbleDelegateView itself is the client's contents view. | 18 // BubbleDelegateView itself is the client's contents view. |
19 // | 19 // |
20 /////////////////////////////////////////////////////////////////////////////// | 20 /////////////////////////////////////////////////////////////////////////////// |
21 class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView { | 21 class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView { |
22 public: | 22 public: |
23 virtual ~BubbleDelegateView(); | 23 virtual ~BubbleDelegateView(); |
24 | 24 |
25 // Create a bubble Widget from the argument BubbleDelegateView. | 25 // Create a bubble Widget from the argument BubbleDelegateView. |
26 static Widget* CreateBubble(BubbleDelegateView* bubble_delegate, | 26 static Widget* CreateBubble(BubbleDelegateView* bubble_delegate, |
27 Widget* parent_widget); | 27 Widget* parent_widget); |
28 | 28 |
29 // WidgetDelegate overrides: | 29 // WidgetDelegate overrides: |
30 virtual View* GetInitiallyFocusedView() OVERRIDE; | |
msw
2011/10/20 19:17:50
already done, will land soon :)
alicet1
2011/10/21 19:13:16
Done.
| |
30 virtual View* GetContentsView() OVERRIDE; | 31 virtual View* GetContentsView() OVERRIDE; |
31 virtual ClientView* CreateClientView(Widget* widget) OVERRIDE; | 32 virtual ClientView* CreateClientView(Widget* widget) OVERRIDE; |
32 virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; | 33 virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE; |
33 | 34 |
34 // Get the arrow's anchor point in screen space. | 35 // Get the arrow's anchor point in screen space. |
35 virtual gfx::Point GetAnchorPoint() const; | 36 virtual gfx::Point GetAnchorPoint() const; |
36 | 37 |
37 // Get the arrow's location on the bubble. | 38 // Get the arrow's location on the bubble. |
38 virtual BubbleBorder::ArrowLocation GetArrowLocation() const; | 39 virtual BubbleBorder::ArrowLocation GetArrowLocation() const; |
39 | 40 |
40 // Get the color used for the background and border. | 41 // Get the color used for the background and border. |
41 virtual SkColor GetColor() const; | 42 virtual SkColor GetColor() const; |
42 | 43 |
43 protected: | 44 protected: |
44 // Perform view initialization on the contents for bubble sizing. | 45 // Perform view initialization on the contents for bubble sizing. |
45 virtual void Init(); | 46 virtual void Init(); |
46 | 47 |
47 private: | 48 private: |
48 const BubbleView* GetBubbleView() const; | 49 const BubbleView* GetBubbleView() const; |
49 const BubbleFrameView* GetBubbleFrameView() const; | 50 const BubbleFrameView* GetBubbleFrameView() const; |
50 | 51 |
51 // Get bubble bounds from the anchor point and client view's preferred size. | 52 // Get bubble bounds from the anchor point and client view's preferred size. |
52 gfx::Rect GetBubbleBounds(); | 53 gfx::Rect GetBubbleBounds(); |
53 }; | 54 }; |
54 | 55 |
55 } // namespace views | 56 } // namespace views |
56 | 57 |
57 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ | 58 #endif // VIEWS_BUBBLE_BUBBLE_DELEGATE_H_ |
OLD | NEW |