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_BORDER_H_ | 5 #ifndef UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 6 #define UI_VIEWS_BUBBLE_BUBBLE_BORDER_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 "ui/views/background.h" | 10 #include "ui/views/background.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 | 116 |
117 // Overridden from Border: | 117 // Overridden from Border: |
118 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; | 118 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; |
119 | 119 |
120 // How many pixels the bubble border is from the edge of the images. | 120 // How many pixels the bubble border is from the edge of the images. |
121 int border_thickness() const; | 121 int border_thickness() const; |
122 | 122 |
123 protected: | 123 protected: |
124 virtual ~BubbleBorder(); | 124 virtual ~BubbleBorder(); |
125 | 125 |
126 // Specifies the arrow location for calculating insets (for rtl mirroring). | |
msw
2012/07/23 22:20:49
I don't understand this comment, nor do I see why
stevenjb
2012/07/23 23:32:06
It gets used in ash::TrayBubbleBorder::Paint. I ca
msw
2012/07/24 00:32:44
Hmm, hopefully we'll end up with a single point of
| |
127 void GetInsetsForArrowLocation(gfx::Insets* insets, | |
128 ArrowLocation arrow_loc) const; | |
129 | |
130 void set_rtl_mirrored(bool mirrored) { rtl_mirrored_ = mirrored; } | |
131 | |
126 private: | 132 private: |
127 struct BorderImages; | 133 struct BorderImages; |
128 | 134 |
129 // Loads images if necessary. | 135 // Loads images if necessary. |
130 static BorderImages* GetBorderImages(Shadow shadow); | 136 static BorderImages* GetBorderImages(Shadow shadow); |
131 | 137 |
132 // Overridden from Border: | 138 // Overridden from Border: |
133 virtual void Paint(const View& view, | 139 virtual void Paint(const View& view, |
134 gfx::Canvas* canvas) const OVERRIDE; | 140 gfx::Canvas* canvas) const OVERRIDE; |
135 | 141 |
(...skipping 23 matching lines...) Expand all Loading... | |
159 int override_arrow_offset_; | 165 int override_arrow_offset_; |
160 | 166 |
161 ArrowLocation arrow_location_; | 167 ArrowLocation arrow_location_; |
162 BubbleAlignment alignment_; | 168 BubbleAlignment alignment_; |
163 SkColor background_color_; | 169 SkColor background_color_; |
164 | 170 |
165 // The client/content bounds; must be clipped from the background on Windows. | 171 // The client/content bounds; must be clipped from the background on Windows. |
166 // TODO(msw): Clean this up when Windows native controls are no longer needed. | 172 // TODO(msw): Clean this up when Windows native controls are no longer needed. |
167 gfx::Rect client_bounds_; | 173 gfx::Rect client_bounds_; |
168 | 174 |
175 // Set this to false avoid mirroring insets for RTL rendering. | |
176 bool rtl_mirrored_; | |
msw
2012/07/23 22:20:49
nit: rename for clarity |mirror_in_rtl_| (or simil
stevenjb
2012/07/26 23:48:30
Removed this and orverrode SetBounds() instead, mo
| |
177 | |
169 DISALLOW_COPY_AND_ASSIGN(BubbleBorder); | 178 DISALLOW_COPY_AND_ASSIGN(BubbleBorder); |
170 }; | 179 }; |
171 | 180 |
172 // A Background that clips itself to the specified BubbleBorder and uses | 181 // A Background that clips itself to the specified BubbleBorder and uses |
173 // the background color of the BubbleBorder. | 182 // the background color of the BubbleBorder. |
174 class VIEWS_EXPORT BubbleBackground : public Background { | 183 class VIEWS_EXPORT BubbleBackground : public Background { |
175 public: | 184 public: |
176 explicit BubbleBackground(BubbleBorder* border) : border_(border) {} | 185 explicit BubbleBackground(BubbleBorder* border) : border_(border) {} |
177 | 186 |
178 // Overridden from Background: | 187 // Overridden from Background: |
179 virtual void Paint(gfx::Canvas* canvas, View* view) const OVERRIDE; | 188 virtual void Paint(gfx::Canvas* canvas, View* view) const OVERRIDE; |
180 | 189 |
181 private: | 190 private: |
182 BubbleBorder* border_; | 191 BubbleBorder* border_; |
183 | 192 |
184 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); | 193 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); |
185 }; | 194 }; |
186 | 195 |
187 } // namespace views | 196 } // namespace views |
188 | 197 |
189 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 198 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
OLD | NEW |