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_BORDER_H_ | 5 #ifndef VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
6 #define VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 6 #define VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "third_party/skia/include/core/SkColor.h" | |
10 #include "views/background.h" | 9 #include "views/background.h" |
11 #include "views/border.h" | 10 #include "views/border.h" |
12 | 11 |
13 class SkBitmap; | 12 class SkBitmap; |
14 | 13 |
15 namespace views { | 14 namespace views { |
16 | 15 |
17 // Renders a border, with optional arrow, and a custom dropshadow. | 16 // Renders a border, with optional arrow, and a custom dropshadow. |
18 // This can be used to produce floating "bubble" objects with rounded corners. | 17 // This can be used to produce floating "bubble" objects with rounded corners. |
19 class VIEWS_EXPORT BubbleBorder : public views::Border { | 18 class VIEWS_EXPORT BubbleBorder : public views::Border { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // overflow it differ from desired. | 100 // overflow it differ from desired. |
102 int SetArrowOffset(int offset, const gfx::Size& contents_size); | 101 int SetArrowOffset(int offset, const gfx::Size& contents_size); |
103 | 102 |
104 // Overridden from views::Border: | 103 // Overridden from views::Border: |
105 virtual void GetInsets(gfx::Insets* insets) const; | 104 virtual void GetInsets(gfx::Insets* insets) const; |
106 | 105 |
107 private: | 106 private: |
108 // Loads images if necessary. | 107 // Loads images if necessary. |
109 static void InitClass(); | 108 static void InitClass(); |
110 | 109 |
111 virtual ~BubbleBorder() { } | 110 virtual ~BubbleBorder(); |
112 | 111 |
113 // Overridden from views::Border: | 112 // Overridden from views::Border: |
114 virtual void Paint(const views::View& view, gfx::Canvas* canvas) const; | 113 virtual void Paint(const views::View& view, gfx::Canvas* canvas) const; |
115 | 114 |
116 void DrawEdgeWithArrow(gfx::Canvas* canvas, | 115 void DrawEdgeWithArrow(gfx::Canvas* canvas, |
117 bool is_horizontal, | 116 bool is_horizontal, |
118 SkBitmap* edge, | 117 SkBitmap* edge, |
119 SkBitmap* arrow, | 118 SkBitmap* arrow, |
120 int start_x, | 119 int start_x, |
121 int start_y, | 120 int start_y, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 166 |
168 private: | 167 private: |
169 BubbleBorder* border_; | 168 BubbleBorder* border_; |
170 | 169 |
171 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); | 170 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); |
172 }; | 171 }; |
173 | 172 |
174 } // namespace views | 173 } // namespace views |
175 | 174 |
176 #endif // VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 175 #endif // VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
OLD | NEW |