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_WINDOW_FRAME_BACKGROUND_H_ | 5 #ifndef UI_VIEWS_WINDOW_FRAME_BACKGROUND_H_ |
6 #define UI_VIEWS_WINDOW_FRAME_BACKGROUND_H_ | 6 #define UI_VIEWS_WINDOW_FRAME_BACKGROUND_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
10 #include "ui/gfx/image/image_skia.h" | 10 #include "ui/gfx/image/image_skia.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 // support in Chrome. It intends to consolidate paint code that historically | 22 // support in Chrome. It intends to consolidate paint code that historically |
23 // was copied. One frame to rule them all! | 23 // was copied. One frame to rule them all! |
24 class VIEWS_EXPORT FrameBackground { | 24 class VIEWS_EXPORT FrameBackground { |
25 public: | 25 public: |
26 FrameBackground(); | 26 FrameBackground(); |
27 ~FrameBackground(); | 27 ~FrameBackground(); |
28 | 28 |
29 // Sets the color to draw under the frame images. | 29 // Sets the color to draw under the frame images. |
30 void set_frame_color(SkColor color) { frame_color_ = color; } | 30 void set_frame_color(SkColor color) { frame_color_ = color; } |
31 | 31 |
32 // Sets whether the frame to be drawn should have focus. | |
Peter Kasting
2017/01/12 18:53:53
Nit: This sounds as if the frame will be given foc
Tom (Use chromium acct)
2017/01/12 21:51:10
Done.
| |
33 void set_is_active(bool is_active) { is_active_ = is_active; } | |
34 | |
32 // Sets the theme image for the top of the window. May be null (empty). | 35 // Sets the theme image for the top of the window. May be null (empty). |
33 // Memory is owned by the caller. | 36 // Memory is owned by the caller. |
34 void set_theme_image(const gfx::ImageSkia& image) { theme_image_ = image; } | 37 void set_theme_image(const gfx::ImageSkia& image) { theme_image_ = image; } |
35 | 38 |
36 // Sets an image that overlays the top window image. Usually used to add | 39 // Sets an image that overlays the top window image. Usually used to add |
37 // edge highlighting to provide the illusion of depth. May be null (empty). | 40 // edge highlighting to provide the illusion of depth. May be null (empty). |
38 // Memory is owned by the caller. | 41 // Memory is owned by the caller. |
39 void set_theme_overlay_image(const gfx::ImageSkia& image) { | 42 void set_theme_overlay_image(const gfx::ImageSkia& image) { |
40 theme_overlay_image_ = image; | 43 theme_overlay_image_ = image; |
41 } | 44 } |
(...skipping 25 matching lines...) Expand all Loading... | |
67 void PaintRestored(gfx::Canvas* canvas, const View* view) const; | 70 void PaintRestored(gfx::Canvas* canvas, const View* view) const; |
68 | 71 |
69 // Paints the border for a maximized window, which does not include the | 72 // Paints the border for a maximized window, which does not include the |
70 // window edges. | 73 // window edges. |
71 void PaintMaximized(gfx::Canvas* canvas, const View* view) const; | 74 void PaintMaximized(gfx::Canvas* canvas, const View* view) const; |
72 | 75 |
73 private: | 76 private: |
74 // Fills the frame area with the frame color. | 77 // Fills the frame area with the frame color. |
75 void PaintFrameColor(gfx::Canvas* canvas, const View* view) const; | 78 void PaintFrameColor(gfx::Canvas* canvas, const View* view) const; |
76 | 79 |
80 // Paints the background of the tab strip. | |
81 void PaintFrameTopArea(gfx::Canvas* canvas, const View* view) const; | |
82 | |
77 SkColor frame_color_; | 83 SkColor frame_color_; |
84 bool is_active_; | |
78 gfx::ImageSkia theme_image_; | 85 gfx::ImageSkia theme_image_; |
79 gfx::ImageSkia theme_overlay_image_; | 86 gfx::ImageSkia theme_overlay_image_; |
80 int top_area_height_; | 87 int top_area_height_; |
81 | 88 |
82 // Images for the sides of the frame. | 89 // Images for the sides of the frame. |
83 const gfx::ImageSkia* left_edge_; | 90 const gfx::ImageSkia* left_edge_; |
84 const gfx::ImageSkia* top_edge_; | 91 const gfx::ImageSkia* top_edge_; |
85 const gfx::ImageSkia* right_edge_; | 92 const gfx::ImageSkia* right_edge_; |
86 const gfx::ImageSkia* bottom_edge_; | 93 const gfx::ImageSkia* bottom_edge_; |
87 | 94 |
88 // Images for the corners of the frame. | 95 // Images for the corners of the frame. |
89 const gfx::ImageSkia* top_left_corner_; | 96 const gfx::ImageSkia* top_left_corner_; |
90 const gfx::ImageSkia* top_right_corner_; | 97 const gfx::ImageSkia* top_right_corner_; |
91 const gfx::ImageSkia* bottom_left_corner_; | 98 const gfx::ImageSkia* bottom_left_corner_; |
92 const gfx::ImageSkia* bottom_right_corner_; | 99 const gfx::ImageSkia* bottom_right_corner_; |
93 | 100 |
94 // Vertical inset for theme image when drawing maximized. | 101 // Vertical inset for theme image when drawing maximized. |
95 int maximized_top_inset_; | 102 int maximized_top_inset_; |
96 | 103 |
97 DISALLOW_COPY_AND_ASSIGN(FrameBackground); | 104 DISALLOW_COPY_AND_ASSIGN(FrameBackground); |
98 }; | 105 }; |
99 | 106 |
100 } // namespace views | 107 } // namespace views |
101 | 108 |
102 #endif // UI_VIEWS_WINDOW_FRAME_BACKGROUND_H_ | 109 #endif // UI_VIEWS_WINDOW_FRAME_BACKGROUND_H_ |
OLD | NEW |