| 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_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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // CustomFrameView | 27 // CustomFrameView |
| 28 // | 28 // |
| 29 // A view that provides the non client frame for Windows. This means | 29 // A view that provides the non client frame for Windows. This means |
| 30 // rendering the non-standard window caption, border, and controls. | 30 // rendering the non-standard window caption, border, and controls. |
| 31 // | 31 // |
| 32 //////////////////////////////////////////////////////////////////////////////// | 32 //////////////////////////////////////////////////////////////////////////////// |
| 33 class VIEWS_EXPORT CustomFrameView : public NonClientFrameView, | 33 class VIEWS_EXPORT CustomFrameView : public NonClientFrameView, |
| 34 public ButtonListener { | 34 public ButtonListener { |
| 35 public: | 35 public: |
| 36 CustomFrameView(); | 36 CustomFrameView(); |
| 37 virtual ~CustomFrameView(); | 37 ~CustomFrameView() override; |
| 38 | 38 |
| 39 void Init(Widget* frame); | 39 void Init(Widget* frame); |
| 40 | 40 |
| 41 // Overridden from NonClientFrameView: | 41 // Overridden from NonClientFrameView: |
| 42 virtual gfx::Rect GetBoundsForClientView() const override; | 42 gfx::Rect GetBoundsForClientView() const override; |
| 43 virtual gfx::Rect GetWindowBoundsForClientBounds( | 43 gfx::Rect GetWindowBoundsForClientBounds( |
| 44 const gfx::Rect& client_bounds) const override; | 44 const gfx::Rect& client_bounds) const override; |
| 45 virtual int NonClientHitTest(const gfx::Point& point) override; | 45 int NonClientHitTest(const gfx::Point& point) override; |
| 46 virtual void GetWindowMask(const gfx::Size& size, | 46 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 47 gfx::Path* window_mask) override; | 47 void ResetWindowControls() override; |
| 48 virtual void ResetWindowControls() override; | 48 void UpdateWindowIcon() override; |
| 49 virtual void UpdateWindowIcon() override; | 49 void UpdateWindowTitle() override; |
| 50 virtual void UpdateWindowTitle() override; | 50 void SizeConstraintsChanged() override; |
| 51 virtual void SizeConstraintsChanged() override; | |
| 52 | 51 |
| 53 // Overridden from View: | 52 // Overridden from View: |
| 54 virtual void OnPaint(gfx::Canvas* canvas) override; | 53 void OnPaint(gfx::Canvas* canvas) override; |
| 55 virtual void Layout() override; | 54 void Layout() override; |
| 56 virtual gfx::Size GetPreferredSize() const override; | 55 gfx::Size GetPreferredSize() const override; |
| 57 virtual gfx::Size GetMinimumSize() const override; | 56 gfx::Size GetMinimumSize() const override; |
| 58 virtual gfx::Size GetMaximumSize() const override; | 57 gfx::Size GetMaximumSize() const override; |
| 59 | 58 |
| 60 // Overridden from ButtonListener: | 59 // Overridden from ButtonListener: |
| 61 virtual void ButtonPressed(Button* sender, const ui::Event& event) override; | 60 void ButtonPressed(Button* sender, const ui::Event& event) override; |
| 62 | 61 |
| 63 private: | 62 private: |
| 64 friend class CustomFrameViewTest; | 63 friend class CustomFrameViewTest; |
| 65 | 64 |
| 66 // Returns the thickness of the border that makes up the window frame edges. | 65 // Returns the thickness of the border that makes up the window frame edges. |
| 67 // This does not include any client edge. | 66 // This does not include any client edge. |
| 68 int FrameBorderThickness() const; | 67 int FrameBorderThickness() const; |
| 69 | 68 |
| 70 // Returns the thickness of the entire nonclient left, right, and bottom | 69 // Returns the thickness of the entire nonclient left, right, and bottom |
| 71 // borders, including both the window frame and any client edge. | 70 // borders, including both the window frame and any client edge. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // by the space used by the leading and trailing buttons. | 153 // by the space used by the leading and trailing buttons. |
| 155 int minimum_title_bar_x_; | 154 int minimum_title_bar_x_; |
| 156 int maximum_title_bar_x_; | 155 int maximum_title_bar_x_; |
| 157 | 156 |
| 158 DISALLOW_COPY_AND_ASSIGN(CustomFrameView); | 157 DISALLOW_COPY_AND_ASSIGN(CustomFrameView); |
| 159 }; | 158 }; |
| 160 | 159 |
| 161 } // namespace views | 160 } // namespace views |
| 162 | 161 |
| 163 #endif // UI_VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ | 162 #endif // UI_VIEWS_WINDOW_CUSTOM_FRAME_VIEW_H_ |
| OLD | NEW |