| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 54 // Sets the active and inactive frame colors. Note the inactive frame color |
| 55 // will have some transparency added when the frame is drawn. | 55 // will have some transparency added when the frame is drawn. |
| 56 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); | 56 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment); | 59 FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment); |
| 60 FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, LightIcons); |
| 60 | 61 |
| 61 // gfx::AnimationDelegate override: | 62 // gfx::AnimationDelegate override: |
| 62 void AnimationProgressed(const gfx::Animation* animation) override; | 63 void AnimationProgressed(const gfx::Animation* animation) override; |
| 63 | 64 |
| 64 // Paints highlight around the edge of the header for inactive restored | 65 // Paints highlight around the edge of the header for inactive restored |
| 65 // windows. | 66 // windows. |
| 66 void PaintHighlightForInactiveRestoredWindow(gfx::Canvas* canvas); | 67 void PaintHighlightForInactiveRestoredWindow(gfx::Canvas* canvas); |
| 67 | 68 |
| 68 // Paints the title bar, primarily the title string. | 69 // Paints the title bar, primarily the title string. |
| 69 void PaintTitleBar(gfx::Canvas* canvas); | 70 void PaintTitleBar(gfx::Canvas* canvas); |
| 70 | 71 |
| 71 // Paints the header/content separator. | 72 // Paints the header/content separator. |
| 72 void PaintHeaderContentSeparator(gfx::Canvas* canvas); | 73 void PaintHeaderContentSeparator(gfx::Canvas* canvas); |
| 73 | 74 |
| 74 // Layout the left header view. | 75 // Layout the left header view. |
| 75 void LayoutLeftHeaderView(); | 76 void LayoutLeftHeaderView(); |
| 76 | 77 |
| 78 // Whether light caption images should be used. This is the case when the |
| 79 // background of the frame is dark. |
| 80 bool ShouldUseLightImages(); |
| 81 |
| 82 // Update all the images in the caption buttons. |
| 83 void UpdateAllButtonImages(); |
| 84 |
| 77 // Updates the size button's images. | 85 // Updates the size button's images. |
| 78 void UpdateSizeButtonImages(); | 86 void UpdateSizeButtonImages(bool use_light_images); |
| 79 | 87 |
| 80 // Returns the header bounds in the coordinates of |view_|. The header is | 88 // Returns the header bounds in the coordinates of |view_|. The header is |
| 81 // assumed to be positioned at the top left corner of |view_| and to have the | 89 // assumed to be positioned at the top left corner of |view_| and to have the |
| 82 // same width as |view_|. | 90 // same width as |view_|. |
| 83 gfx::Rect GetLocalBounds() const; | 91 gfx::Rect GetLocalBounds() const; |
| 84 | 92 |
| 85 // Returns the bounds for the title. | 93 // Returns the bounds for the title. |
| 86 gfx::Rect GetTitleBounds() const; | 94 gfx::Rect GetTitleBounds() const; |
| 87 | 95 |
| 88 // Returns whether the frame uses custom frame coloring. | 96 // Returns whether the frame uses custom frame coloring. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 106 bool initial_paint_; | 114 bool initial_paint_; |
| 107 | 115 |
| 108 scoped_ptr<gfx::SlideAnimation> activation_animation_; | 116 scoped_ptr<gfx::SlideAnimation> activation_animation_; |
| 109 | 117 |
| 110 DISALLOW_COPY_AND_ASSIGN(DefaultHeaderPainter); | 118 DISALLOW_COPY_AND_ASSIGN(DefaultHeaderPainter); |
| 111 }; | 119 }; |
| 112 | 120 |
| 113 } // namespace ash | 121 } // namespace ash |
| 114 | 122 |
| 115 #endif // ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ | 123 #endif // ASH_FRAME_DEFAULT_HEADER_PAINTER_H_ |
| OLD | NEW |