OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "third_party/skia/include/core/SkColor.h" | 11 #include "third_party/skia/include/core/SkColor.h" |
12 #include "ui/gfx/insets.h" | 12 #include "ui/gfx/insets.h" |
13 #include "ui/views/bubble/bubble_border.h" | 13 #include "ui/views/bubble/bubble_border.h" |
14 #include "ui/views/window/non_client_view.h" | 14 #include "ui/views/window/non_client_view.h" |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 | 17 |
18 // This is a NonClientFrameView used to render the BubbleBorder. | 18 // This is a NonClientFrameView used to render the BubbleBorder. |
19 class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView { | 19 class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView { |
20 public: | 20 public: |
21 BubbleFrameView(BubbleBorder::ArrowLocation arrow_location, | 21 // Sets the border to |border|, taking ownership. Important: do not call |
22 SkColor color, | 22 // set_border() directly to change the border, use SetBubbleBorder() instead. |
23 const gfx::Insets& margins); | 23 BubbleFrameView(const gfx::Insets& margins, BubbleBorder* border); |
24 virtual ~BubbleFrameView(); | 24 virtual ~BubbleFrameView(); |
25 | 25 |
26 // NonClientFrameView overrides: | 26 // NonClientFrameView overrides: |
27 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 27 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
28 virtual gfx::Rect GetWindowBoundsForClientBounds( | 28 virtual gfx::Rect GetWindowBoundsForClientBounds( |
29 const gfx::Rect& client_bounds) const OVERRIDE; | 29 const gfx::Rect& client_bounds) const OVERRIDE; |
30 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 30 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
31 virtual void GetWindowMask(const gfx::Size& size, | 31 virtual void GetWindowMask(const gfx::Size& size, |
32 gfx::Path* window_mask) OVERRIDE {} | 32 gfx::Path* window_mask) OVERRIDE {} |
33 virtual void ResetWindowControls() OVERRIDE {} | 33 virtual void ResetWindowControls() OVERRIDE {} |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Margins between the content and the inside of the border, in pixels. | 69 // Margins between the content and the inside of the border, in pixels. |
70 gfx::Insets content_margins_; | 70 gfx::Insets content_margins_; |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); | 72 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace views | 75 } // namespace views |
76 | 76 |
77 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ | 77 #endif // UI_VIEWS_BUBBLE_BUBBLE_FRAME_VIEW_H_ |
OLD | NEW |