| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/views/frame/aero_glass_frame.h" | 8 #include "chrome/browser/views/frame/aero_glass_frame.h" |
| 9 #include "chrome/views/non_client_view.h" | 9 #include "chrome/views/non_client_view.h" |
| 10 #include "chrome/views/button.h" | 10 #include "chrome/views/button.h" |
| 11 | 11 |
| 12 class BrowserView; | 12 class BrowserView; |
| 13 class AeroGlassWindowResources; | 13 class AeroGlassWindowResources; |
| 14 | 14 |
| 15 class AeroGlassNonClientView : public views::NonClientView { | 15 class AeroGlassNonClientView : public views::NonClientView { |
| 16 public: | 16 public: |
| 17 // Constructs a non-client view for an AeroGlassFrame. | 17 // Constructs a non-client view for an AeroGlassFrame. |
| 18 AeroGlassNonClientView(AeroGlassFrame* frame, BrowserView* browser_view); | 18 AeroGlassNonClientView(AeroGlassFrame* frame, BrowserView* browser_view); |
| 19 virtual ~AeroGlassNonClientView(); | 19 virtual ~AeroGlassNonClientView(); |
| 20 | 20 |
| 21 // Retrieve the bounds for the specified |tabstrip|, in the coordinate system | 21 // Retrieve the bounds for the specified |tabstrip|, in the coordinate system |
| 22 // of the non-client view (which whould be window coordinates). | 22 // of the non-client view (which whould be window coordinates). |
| 23 gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip); | 23 gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip); |
| 24 | 24 |
| 25 protected: | 25 protected: |
| 26 // Overridden from views::NonClientView: | 26 // Overridden from views::NonClientView: |
| 27 virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; | 27 virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; |
| 28 virtual gfx::Size CalculateWindowSizeForClientSize(int width, | |
| 29 int height) const; | |
| 30 virtual CPoint GetSystemMenuPoint() const; | 28 virtual CPoint GetSystemMenuPoint() const; |
| 31 virtual int NonClientHitTest(const gfx::Point& point); | 29 virtual int NonClientHitTest(const gfx::Point& point); |
| 32 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); | 30 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) { } |
| 33 virtual void EnableClose(bool enable); | 31 virtual void EnableClose(bool enable) { } |
| 34 virtual void ResetWindowControls(); | 32 virtual void ResetWindowControls() { } |
| 35 | 33 |
| 36 // Overridden from views::View: | 34 // Overridden from views::View: |
| 37 virtual void Paint(ChromeCanvas* canvas); | 35 virtual void Paint(ChromeCanvas* canvas); |
| 38 virtual void Layout(); | 36 virtual void Layout(); |
| 39 virtual gfx::Size GetPreferredSize(); | |
| 40 virtual void ViewHierarchyChanged(bool is_add, | 37 virtual void ViewHierarchyChanged(bool is_add, |
| 41 views::View* parent, | 38 views::View* parent, |
| 42 views::View* child); | 39 views::View* child); |
| 43 | 40 |
| 44 private: | 41 private: |
| 45 // Returns the height of the non-client area at the top of the window (the | 42 // Returns the thickness of the border that makes up the window frame edges. |
| 46 // title bar, etc). | 43 // This does not include any client edge. |
| 47 int CalculateNonClientTopHeight() const; | 44 int FrameBorderThickness() const; |
| 45 |
| 46 // Returns the thickness of the entire nonclient left, right, and bottom |
| 47 // borders, including both the window frame and any client edge. |
| 48 int NonClientBorderThickness() const; |
| 49 |
| 50 // Returns the height of the entire nonclient top border, including the window |
| 51 // frame, any title area, and any connected client edge. |
| 52 int NonClientTopBorderHeight() const; |
| 48 | 53 |
| 49 // Paint various sub-components of this view. | 54 // Paint various sub-components of this view. |
| 50 void PaintOTRAvatar(ChromeCanvas* canvas); | |
| 51 void PaintDistributorLogo(ChromeCanvas* canvas); | 55 void PaintDistributorLogo(ChromeCanvas* canvas); |
| 52 void PaintToolbarBackground(ChromeCanvas* canvas); | 56 void PaintToolbarBackground(ChromeCanvas* canvas); |
| 57 void PaintOTRAvatar(ChromeCanvas* canvas); |
| 53 void PaintClientEdge(ChromeCanvas* canvas); | 58 void PaintClientEdge(ChromeCanvas* canvas); |
| 54 | 59 |
| 55 // Layout various sub-components of this view. | 60 // Layout various sub-components of this view. |
| 61 void LayoutDistributorLogo(); |
| 56 void LayoutOTRAvatar(); | 62 void LayoutOTRAvatar(); |
| 57 void LayoutDistributorLogo(); | |
| 58 void LayoutClientView(); | 63 void LayoutClientView(); |
| 59 | 64 |
| 60 // The layout rect of the distributor logo, if visible. | 65 // The layout rect of the distributor logo, if visible. |
| 61 gfx::Rect logo_bounds_; | 66 gfx::Rect logo_bounds_; |
| 62 | 67 |
| 63 // The layout rect of the OTR avatar. | 68 // The layout rect of the OTR avatar. |
| 64 gfx::Rect otr_avatar_bounds_; | 69 gfx::Rect otr_avatar_bounds_; |
| 65 | 70 |
| 66 // The frame that hosts this view. | 71 // The frame that hosts this view. |
| 67 AeroGlassFrame* frame_; | 72 AeroGlassFrame* frame_; |
| 68 | 73 |
| 69 // The BrowserView that we contain. | 74 // The BrowserView that we contain. |
| 70 BrowserView* browser_view_; | 75 BrowserView* browser_view_; |
| 71 | 76 |
| 72 static void InitClass(); | 77 static void InitClass(); |
| 73 static SkBitmap distributor_logo_; | 78 static SkBitmap distributor_logo_; |
| 74 static AeroGlassWindowResources* resources_; | 79 static AeroGlassWindowResources* resources_; |
| 75 | 80 |
| 76 DISALLOW_EVIL_CONSTRUCTORS(AeroGlassNonClientView); | 81 DISALLOW_EVIL_CONSTRUCTORS(AeroGlassNonClientView); |
| 77 }; | 82 }; |
| 78 | 83 |
| 79 #endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ | 84 #endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_AERO_GLASS_NON_CLIENT_VIEW_H_ |
| 80 | 85 |
| OLD | NEW |