| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_HEADER_PAINTER_H_ | 5 #ifndef MASH_WM_FRAME_HEADER_PAINTER_H_ |
| 6 #define ASH_FRAME_HEADER_PAINTER_H_ | 6 #define MASH_WM_FRAME_HEADER_PAINTER_H_ |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 | 7 |
| 10 namespace gfx { | 8 namespace gfx { |
| 11 class Canvas; | 9 class Canvas; |
| 12 } | 10 } |
| 13 | 11 |
| 14 namespace ash { | 12 namespace mash { |
| 13 namespace wm { |
| 15 | 14 |
| 16 // Helper class for painting the window header. | 15 // Helper class for painting the window header. |
| 17 class ASH_EXPORT HeaderPainter { | 16 // TODO(sky): keep this only if we're going to actually need different |
| 17 // subclasses. |
| 18 class HeaderPainter { |
| 18 public: | 19 public: |
| 19 enum Mode { | 20 enum Mode { MODE_ACTIVE, MODE_INACTIVE }; |
| 20 MODE_ACTIVE, | |
| 21 MODE_INACTIVE | |
| 22 }; | |
| 23 | 21 |
| 24 virtual ~HeaderPainter() { | 22 virtual ~HeaderPainter() {} |
| 25 } | |
| 26 | 23 |
| 27 // Returns the header's minimum width. | 24 // Returns the header's minimum width. |
| 28 virtual int GetMinimumHeaderWidth() const = 0; | 25 virtual int GetMinimumHeaderWidth() const = 0; |
| 29 | 26 |
| 30 // Paints the header. | 27 // Paints the header. |
| 31 virtual void PaintHeader(gfx::Canvas* canvas, Mode mode) = 0; | 28 virtual void PaintHeader(gfx::Canvas* canvas, Mode mode) = 0; |
| 32 | 29 |
| 33 // Performs layout for the header. | 30 // Performs layout for the header. |
| 34 virtual void LayoutHeader() = 0; | 31 virtual void LayoutHeader() = 0; |
| 35 | 32 |
| 36 // Get the height of the header. | 33 // Get the height of the header. |
| 37 virtual int GetHeaderHeight() const = 0; | 34 virtual int GetHeaderHeight() const = 0; |
| 38 | 35 |
| 39 // Gets / sets how much of the header is painted. This allows the header to | 36 // Gets / sets how much of the header is painted. This allows the header to |
| 40 // paint under things (like the tabstrip) which have transparent / | 37 // paint under things (like the tabstrip) which have transparent / |
| 41 // non-painting sections. This height does not affect LayoutHeader(). | 38 // non-painting sections. This height does not affect LayoutHeader(). |
| 42 virtual int GetHeaderHeightForPainting() const = 0; | 39 virtual int GetHeaderHeightForPainting() const = 0; |
| 43 virtual void SetHeaderHeightForPainting(int height_for_painting) = 0; | 40 virtual void SetHeaderHeightForPainting(int height_for_painting) = 0; |
| 44 | 41 |
| 45 // Schedule a re-paint of the entire title. | 42 // Schedule a re-paint of the entire title. |
| 46 virtual void SchedulePaintForTitle() = 0; | 43 virtual void SchedulePaintForTitle() = 0; |
| 47 | 44 |
| 48 // Updates the x inset of the leftmost view in the header. | 45 // Updates the x inset of the leftmost view in the header. |
| 49 virtual void UpdateLeftViewXInset(int left_view_x_inset) = 0; | 46 virtual void UpdateLeftViewXInset(int left_view_x_inset) = 0; |
| 50 }; | 47 }; |
| 51 | 48 |
| 52 } // namespace ash | 49 } // namespace wm |
| 50 } // namespace mash |
| 53 | 51 |
| 54 #endif // ASH_FRAME_HEADER_PAINTER_H_ | 52 #endif // MASH_WM_FRAME_HEADER_PAINTER_H_ |
| OLD | NEW |