OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ | 5 #ifndef ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ |
6 #define ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ | 6 #define ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/frame/header_painter.h" | 9 #include "ash/frame/header_painter.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual void PaintHeader(gfx::Canvas* canvas, Mode mode) override; | 44 virtual void PaintHeader(gfx::Canvas* canvas, Mode mode) override; |
45 virtual void LayoutHeader() override; | 45 virtual void LayoutHeader() override; |
46 virtual int GetHeaderHeightForPainting() const override; | 46 virtual int GetHeaderHeightForPainting() const override; |
47 virtual void SetHeaderHeightForPainting(int height) override; | 47 virtual void SetHeaderHeightForPainting(int height) override; |
48 virtual void SchedulePaintForTitle() override; | 48 virtual void SchedulePaintForTitle() override; |
49 virtual void UpdateLeftViewXInset(int left_view_x_inset) override; | 49 virtual void UpdateLeftViewXInset(int left_view_x_inset) override; |
50 | 50 |
51 // Sets the left header view for the header. Passing NULL removes the view. | 51 // Sets the left header view for the header. Passing NULL removes the view. |
52 void UpdateLeftHeaderView(views::View* left_header_view); | 52 void UpdateLeftHeaderView(views::View* left_header_view); |
53 | 53 |
| 54 // Sets the active and inactive frame colors. Note the inactive frame color |
| 55 // will have some transparency added when the frame is drawn. |
| 56 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); |
| 57 |
54 private: | 58 private: |
55 FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment); | 59 FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment); |
56 | 60 |
57 // gfx::AnimationDelegate override: | 61 // gfx::AnimationDelegate override: |
58 virtual void AnimationProgressed(const gfx::Animation* animation) override; | 62 virtual void AnimationProgressed(const gfx::Animation* animation) override; |
59 | 63 |
60 // Paints highlight around the edge of the header for inactive restored | 64 // Paints highlight around the edge of the header for inactive restored |
61 // windows. | 65 // windows. |
62 void PaintHighlightForInactiveRestoredWindow(gfx::Canvas* canvas); | 66 void PaintHighlightForInactiveRestoredWindow(gfx::Canvas* canvas); |
63 | 67 |
(...skipping 17 matching lines...) Expand all Loading... |
81 // Returns the bounds for the title. | 85 // Returns the bounds for the title. |
82 gfx::Rect GetTitleBounds() const; | 86 gfx::Rect GetTitleBounds() const; |
83 | 87 |
84 // Returns the frame color to use when |frame_| is inactive. | 88 // Returns the frame color to use when |frame_| is inactive. |
85 SkColor GetInactiveFrameColor() const; | 89 SkColor GetInactiveFrameColor() const; |
86 | 90 |
87 views::Widget* frame_; | 91 views::Widget* frame_; |
88 views::View* view_; | 92 views::View* view_; |
89 views::View* left_header_view_; // May be NULL. | 93 views::View* left_header_view_; // May be NULL. |
90 int left_view_x_inset_; | 94 int left_view_x_inset_; |
| 95 SkColor active_frame_color_; |
| 96 SkColor inactive_frame_color_; |
91 FrameCaptionButtonContainerView* caption_button_container_; | 97 FrameCaptionButtonContainerView* caption_button_container_; |
92 | 98 |
93 // The height of the header including the header/content separator. | 99 // The height of the header including the header/content separator. |
94 int height_; | 100 int height_; |
95 | 101 |
96 // Whether the header should be painted as active. | 102 // Whether the header should be painted as active. |
97 Mode mode_; | 103 Mode mode_; |
98 | 104 |
99 // Whether the header is painted for the first time. | 105 // Whether the header is painted for the first time. |
100 bool initial_paint_; | 106 bool initial_paint_; |
101 | 107 |
102 scoped_ptr<gfx::SlideAnimation> activation_animation_; | 108 scoped_ptr<gfx::SlideAnimation> activation_animation_; |
103 | 109 |
104 DISALLOW_COPY_AND_ASSIGN(DefaultHeaderPainter); | 110 DISALLOW_COPY_AND_ASSIGN(DefaultHeaderPainter); |
105 }; | 111 }; |
106 | 112 |
107 } // namespace ash | 113 } // namespace ash |
108 | 114 |
109 #endif // ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ | 115 #endif // ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ |
OLD | NEW |