| 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. |
| 33 void set_is_active(bool is_active) { is_active_ = is_active; } |
| 34 |
| 35 // Sets whether the frame to be drawn is in incognito mode. |
| 36 void set_incognito(bool incognito) { incognito_ = incognito; } |
| 37 |
| 32 // Sets the theme image for the top of the window. May be null (empty). | 38 // Sets the theme image for the top of the window. May be null (empty). |
| 33 // Memory is owned by the caller. | 39 // Memory is owned by the caller. |
| 34 void set_theme_image(const gfx::ImageSkia& image) { theme_image_ = image; } | 40 void set_theme_image(const gfx::ImageSkia& image) { theme_image_ = image; } |
| 35 | 41 |
| 36 // Sets an image that overlays the top window image. Usually used to add | 42 // 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). | 43 // edge highlighting to provide the illusion of depth. May be null (empty). |
| 38 // Memory is owned by the caller. | 44 // Memory is owned by the caller. |
| 39 void set_theme_overlay_image(const gfx::ImageSkia& image) { | 45 void set_theme_overlay_image(const gfx::ImageSkia& image) { |
| 40 theme_overlay_image_ = image; | 46 theme_overlay_image_ = image; |
| 41 } | 47 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 67 void PaintRestored(gfx::Canvas* canvas, const View* view) const; | 73 void PaintRestored(gfx::Canvas* canvas, const View* view) const; |
| 68 | 74 |
| 69 // Paints the border for a maximized window, which does not include the | 75 // Paints the border for a maximized window, which does not include the |
| 70 // window edges. | 76 // window edges. |
| 71 void PaintMaximized(gfx::Canvas* canvas, const View* view) const; | 77 void PaintMaximized(gfx::Canvas* canvas, const View* view) const; |
| 72 | 78 |
| 73 private: | 79 private: |
| 74 // Fills the frame area with the frame color. | 80 // Fills the frame area with the frame color. |
| 75 void PaintFrameColor(gfx::Canvas* canvas, const View* view) const; | 81 void PaintFrameColor(gfx::Canvas* canvas, const View* view) const; |
| 76 | 82 |
| 83 // Paints the background of the tab strip. |
| 84 void PaintFrameTopArea(gfx::Canvas* canvas, const View* view) const; |
| 85 |
| 77 SkColor frame_color_; | 86 SkColor frame_color_; |
| 87 bool is_active_; |
| 88 bool incognito_; |
| 78 gfx::ImageSkia theme_image_; | 89 gfx::ImageSkia theme_image_; |
| 79 gfx::ImageSkia theme_overlay_image_; | 90 gfx::ImageSkia theme_overlay_image_; |
| 80 int top_area_height_; | 91 int top_area_height_; |
| 81 | 92 |
| 82 // Images for the sides of the frame. | 93 // Images for the sides of the frame. |
| 83 const gfx::ImageSkia* left_edge_; | 94 const gfx::ImageSkia* left_edge_; |
| 84 const gfx::ImageSkia* top_edge_; | 95 const gfx::ImageSkia* top_edge_; |
| 85 const gfx::ImageSkia* right_edge_; | 96 const gfx::ImageSkia* right_edge_; |
| 86 const gfx::ImageSkia* bottom_edge_; | 97 const gfx::ImageSkia* bottom_edge_; |
| 87 | 98 |
| 88 // Images for the corners of the frame. | 99 // Images for the corners of the frame. |
| 89 const gfx::ImageSkia* top_left_corner_; | 100 const gfx::ImageSkia* top_left_corner_; |
| 90 const gfx::ImageSkia* top_right_corner_; | 101 const gfx::ImageSkia* top_right_corner_; |
| 91 const gfx::ImageSkia* bottom_left_corner_; | 102 const gfx::ImageSkia* bottom_left_corner_; |
| 92 const gfx::ImageSkia* bottom_right_corner_; | 103 const gfx::ImageSkia* bottom_right_corner_; |
| 93 | 104 |
| 94 // Vertical inset for theme image when drawing maximized. | 105 // Vertical inset for theme image when drawing maximized. |
| 95 int maximized_top_inset_; | 106 int maximized_top_inset_; |
| 96 | 107 |
| 97 DISALLOW_COPY_AND_ASSIGN(FrameBackground); | 108 DISALLOW_COPY_AND_ASSIGN(FrameBackground); |
| 98 }; | 109 }; |
| 99 | 110 |
| 100 } // namespace views | 111 } // namespace views |
| 101 | 112 |
| 102 #endif // UI_VIEWS_WINDOW_FRAME_BACKGROUND_H_ | 113 #endif // UI_VIEWS_WINDOW_FRAME_BACKGROUND_H_ |
| OLD | NEW |