| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
| 14 #include "ui/views/background.h" | 14 #include "ui/views/background.h" |
| 15 #include "ui/views/border.h" | 15 #include "ui/views/border.h" |
| 16 | 16 |
| 17 class SkPath; | 17 class SkPath; |
| 18 class SkRRect; |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class Path; | 21 class Path; |
| 21 class Rect; | 22 class Rect; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace views { | 25 namespace views { |
| 25 class Painter; | 26 class Painter; |
| 26 | 27 |
| 27 namespace internal { | 28 namespace internal { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // The border and arrow stroke size used in image assets, in pixels. | 224 // The border and arrow stroke size used in image assets, in pixels. |
| 224 static const int kStroke; | 225 static const int kStroke; |
| 225 | 226 |
| 226 gfx::Size GetSizeForContentsSize(const gfx::Size& contents_size) const; | 227 gfx::Size GetSizeForContentsSize(const gfx::Size& contents_size) const; |
| 227 gfx::ImageSkia* GetArrowImage() const; | 228 gfx::ImageSkia* GetArrowImage() const; |
| 228 gfx::Rect GetArrowRect(const gfx::Rect& bounds) const; | 229 gfx::Rect GetArrowRect(const gfx::Rect& bounds) const; |
| 229 void GetArrowPathFromArrowBounds(const gfx::Rect& arrow_bounds, | 230 void GetArrowPathFromArrowBounds(const gfx::Rect& arrow_bounds, |
| 230 SkPath* path) const; | 231 SkPath* path) const; |
| 231 void DrawArrow(gfx::Canvas* canvas, const gfx::Rect& arrow_bounds) const; | 232 void DrawArrow(gfx::Canvas* canvas, const gfx::Rect& arrow_bounds) const; |
| 232 | 233 |
| 234 // Returns the region within |view| representing the client area. This can be |
| 235 // set as a canvas clip to ensure any fill or shadow from the border does not |
| 236 // draw over the contents of the bubble. |
| 237 SkRRect GetClientRect(const View& view) const; |
| 238 |
| 239 // Paints an MD border. Ignores |shadow_|. |
| 233 void PaintMd(const View& view, gfx::Canvas* canvas); | 240 void PaintMd(const View& view, gfx::Canvas* canvas); |
| 234 | 241 |
| 242 // Paint for the NO_ASSETS shadow type. This just paints transparent pixels |
| 243 // to make the window shape based on insets and GetBorderCornerRadius(). |
| 244 void PaintNoAssets(const View& view, gfx::Canvas* canvas); |
| 245 |
| 235 internal::BorderImages* GetImagesForTest() const; | 246 internal::BorderImages* GetImagesForTest() const; |
| 236 | 247 |
| 237 Arrow arrow_; | 248 Arrow arrow_; |
| 238 int arrow_offset_; | 249 int arrow_offset_; |
| 239 ArrowPaintType arrow_paint_type_; | 250 ArrowPaintType arrow_paint_type_; |
| 240 BubbleAlignment alignment_; | 251 BubbleAlignment alignment_; |
| 241 Shadow shadow_; | 252 Shadow shadow_; |
| 242 internal::BorderImages* images_; | 253 internal::BorderImages* images_; |
| 243 SkColor background_color_; | 254 SkColor background_color_; |
| 244 bool use_theme_background_color_; | 255 bool use_theme_background_color_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 257 | 268 |
| 258 private: | 269 private: |
| 259 BubbleBorder* border_; | 270 BubbleBorder* border_; |
| 260 | 271 |
| 261 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); | 272 DISALLOW_COPY_AND_ASSIGN(BubbleBackground); |
| 262 }; | 273 }; |
| 263 | 274 |
| 264 } // namespace views | 275 } // namespace views |
| 265 | 276 |
| 266 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ | 277 #endif // UI_VIEWS_BUBBLE_BUBBLE_BORDER_H_ |
| OLD | NEW |