| OLD | NEW |
| 1 // Copyright (c) 2011 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_CUSTOM_FRAME_VIEW_H_ | 5 #ifndef UI_VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ |
| 6 #define UI_VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ | 6 #define UI_VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/views/controls/button/image_button.h" | 9 #include "ui/views/controls/button/image_button.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| 11 #include "ui/views/window/non_client_view.h" | 11 #include "ui/views/window/non_client_view.h" |
| 12 | 12 |
| 13 class SkBitmap; | 13 class SkBitmap; |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Canvas; | 15 class CanvasSkia; |
| 16 class Font; | 16 class Font; |
| 17 class Size; | 17 class Size; |
| 18 class Path; | 18 class Path; |
| 19 class Point; | 19 class Point; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace views { | 22 namespace views { |
| 23 | 23 |
| 24 class FrameBackground; | 24 class FrameBackground; |
| 25 | 25 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 41 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 41 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
| 42 virtual gfx::Rect GetWindowBoundsForClientBounds( | 42 virtual gfx::Rect GetWindowBoundsForClientBounds( |
| 43 const gfx::Rect& client_bounds) const OVERRIDE; | 43 const gfx::Rect& client_bounds) const OVERRIDE; |
| 44 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 44 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
| 45 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) | 45 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) |
| 46 OVERRIDE; | 46 OVERRIDE; |
| 47 virtual void ResetWindowControls() OVERRIDE; | 47 virtual void ResetWindowControls() OVERRIDE; |
| 48 virtual void UpdateWindowIcon() OVERRIDE; | 48 virtual void UpdateWindowIcon() OVERRIDE; |
| 49 | 49 |
| 50 // View overrides: | 50 // View overrides: |
| 51 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 51 virtual void OnPaint(gfx::CanvasSkia* canvas) OVERRIDE; |
| 52 virtual void Layout() OVERRIDE; | 52 virtual void Layout() OVERRIDE; |
| 53 virtual gfx::Size GetPreferredSize() OVERRIDE; | 53 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 54 | 54 |
| 55 // ButtonListener implementation: | 55 // ButtonListener implementation: |
| 56 virtual void ButtonPressed(Button* sender, const views::Event& event) | 56 virtual void ButtonPressed(Button* sender, const views::Event& event) |
| 57 OVERRIDE; | 57 OVERRIDE; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Returns the thickness of the border that makes up the window frame edges. | 60 // Returns the thickness of the border that makes up the window frame edges. |
| 61 // This does not include any client edge. | 61 // This does not include any client edge. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 82 | 82 |
| 83 // Returns the bounds of the titlebar icon (or where the icon would be if | 83 // Returns the bounds of the titlebar icon (or where the icon would be if |
| 84 // there was one). | 84 // there was one). |
| 85 gfx::Rect IconBounds() const; | 85 gfx::Rect IconBounds() const; |
| 86 | 86 |
| 87 // Returns true if the client edge should be drawn. This is true if | 87 // Returns true if the client edge should be drawn. This is true if |
| 88 // the window delegate wants a client edge and we are not maxmized. | 88 // the window delegate wants a client edge and we are not maxmized. |
| 89 bool ShouldShowClientEdge() const; | 89 bool ShouldShowClientEdge() const; |
| 90 | 90 |
| 91 // Paint various sub-components of this view. | 91 // Paint various sub-components of this view. |
| 92 void PaintRestoredFrameBorder(gfx::Canvas* canvas); | 92 void PaintRestoredFrameBorder(gfx::CanvasSkia* canvas); |
| 93 void PaintMaximizedFrameBorder(gfx::Canvas* canvas); | 93 void PaintMaximizedFrameBorder(gfx::CanvasSkia* canvas); |
| 94 void PaintTitleBar(gfx::Canvas* canvas); | 94 void PaintTitleBar(gfx::CanvasSkia* canvas); |
| 95 void PaintRestoredClientEdge(gfx::Canvas* canvas); | 95 void PaintRestoredClientEdge(gfx::CanvasSkia* canvas); |
| 96 | 96 |
| 97 // Compute aspects of the frame needed to paint the frame background. | 97 // Compute aspects of the frame needed to paint the frame background. |
| 98 SkColor GetFrameColor() const; | 98 SkColor GetFrameColor() const; |
| 99 SkBitmap* GetFrameBitmap() const; | 99 SkBitmap* GetFrameBitmap() const; |
| 100 | 100 |
| 101 // Layout various sub-components of this view. | 101 // Layout various sub-components of this view. |
| 102 void LayoutWindowControls(); | 102 void LayoutWindowControls(); |
| 103 void LayoutTitleBar(); | 103 void LayoutTitleBar(); |
| 104 void LayoutClientView(); | 104 void LayoutClientView(); |
| 105 | 105 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 127 // Initialize various static resources. | 127 // Initialize various static resources. |
| 128 static void InitClass(); | 128 static void InitClass(); |
| 129 static gfx::Font* title_font_; | 129 static gfx::Font* title_font_; |
| 130 | 130 |
| 131 DISALLOW_COPY_AND_ASSIGN(CustomFrameView); | 131 DISALLOW_COPY_AND_ASSIGN(CustomFrameView); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace views | 134 } // namespace views |
| 135 | 135 |
| 136 #endif // UI_VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ | 136 #endif // UI_VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ |
| OLD | NEW |