| 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 CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
| 11 #include "ui/views/window/non_client_view.h" | 11 #include "ui/views/window/non_client_view.h" |
| 12 | 12 |
| 13 class BrowserView; | 13 class BrowserView; |
| 14 | 14 |
| 15 class GlassBrowserFrameView : public BrowserNonClientFrameView, | 15 class GlassBrowserFrameView : public BrowserNonClientFrameView, |
| 16 public views::ButtonListener { | 16 public views::ButtonListener { |
| 17 public: | 17 public: |
| 18 // Constructs a non-client view for an BrowserFrame. | 18 // Constructs a non-client view for an BrowserFrame. |
| 19 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 19 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 20 ~GlassBrowserFrameView() override; | 20 ~GlassBrowserFrameView() override; |
| 21 | 21 |
| 22 // BrowserNonClientFrameView: | 22 // BrowserNonClientFrameView: |
| 23 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; | 23 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; |
| 24 int GetTopInset() const override; | 24 int GetTopInset(bool restored) const override; |
| 25 int GetThemeBackgroundXInset() const override; | 25 int GetThemeBackgroundXInset() const override; |
| 26 void UpdateThrobber(bool running) override; | 26 void UpdateThrobber(bool running) override; |
| 27 gfx::Size GetMinimumSize() const override; | 27 gfx::Size GetMinimumSize() const override; |
| 28 | 28 |
| 29 // views::NonClientFrameView: | 29 // views::NonClientFrameView: |
| 30 gfx::Rect GetBoundsForClientView() const override; | 30 gfx::Rect GetBoundsForClientView() const override; |
| 31 gfx::Rect GetWindowBoundsForClientBounds( | 31 gfx::Rect GetWindowBoundsForClientBounds( |
| 32 const gfx::Rect& client_bounds) const override; | 32 const gfx::Rect& client_bounds) const override; |
| 33 int NonClientHitTest(const gfx::Point& point) override; | 33 int NonClientHitTest(const gfx::Point& point) override; |
| 34 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {} | 34 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {} |
| (...skipping 15 matching lines...) Expand all Loading... |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // views::NonClientFrameView: | 52 // views::NonClientFrameView: |
| 53 bool DoesIntersectRect(const views::View* target, | 53 bool DoesIntersectRect(const views::View* target, |
| 54 const gfx::Rect& rect) const override; | 54 const gfx::Rect& rect) const override; |
| 55 | 55 |
| 56 // Returns the thickness of the border that makes up the window left, right, | 56 // Returns the thickness of the border that makes up the window left, right, |
| 57 // and bottom frame edges. This does not include any client edge. | 57 // and bottom frame edges. This does not include any client edge. |
| 58 int FrameBorderThickness() const; | 58 int FrameBorderThickness() const; |
| 59 | 59 |
| 60 // Returns the height of the window top frame edge. | 60 // Returns the height of the window top frame edge. If |restored| is true, |
| 61 int FrameTopBorderHeight() const; | 61 // this is calculated as if the window was restored, regardless of its current |
| 62 // state. |
| 63 int FrameTopBorderHeight(bool restored) const; |
| 62 | 64 |
| 63 // Returns the thickness of the entire nonclient left, right, and bottom | 65 // Returns the thickness of the entire nonclient left, right, and bottom |
| 64 // borders, including both the window frame and any client edge. | 66 // borders, including both the window frame and any client edge. If |restored| |
| 65 int NonClientBorderThickness() const; | 67 // is true, this is calculated as if the window was restored, regardless of |
| 68 // its current state. |
| 69 int NonClientBorderThickness(bool restored) const; |
| 66 | 70 |
| 67 // Returns the height of the entire nonclient top border, including the window | 71 // Returns the height of the entire nonclient top border, including the window |
| 68 // frame, any title area, and any connected client edge. | 72 // frame, any title area, and any connected client edge. If |restored| is |
| 69 int NonClientTopBorderHeight() const; | 73 // true, this is calculated as if the window was restored, regardless of its |
| 74 // current state. |
| 75 int NonClientTopBorderHeight(bool restored) const; |
| 70 | 76 |
| 71 // Paint various sub-components of this view. | 77 // Paint various sub-components of this view. |
| 72 void PaintToolbarBackground(gfx::Canvas* canvas); | 78 void PaintToolbarBackground(gfx::Canvas* canvas); |
| 73 void PaintRestoredClientEdge(gfx::Canvas* canvas); | 79 void PaintRestoredClientEdge(gfx::Canvas* canvas); |
| 74 | 80 |
| 75 // Layout various sub-components of this view. | 81 // Layout various sub-components of this view. |
| 76 void LayoutIncognitoIcon(); | 82 void LayoutIncognitoIcon(); |
| 77 void LayoutNewStyleAvatar(); | 83 void LayoutNewStyleAvatar(); |
| 78 void LayoutClientView(); | 84 void LayoutClientView(); |
| 79 | 85 |
| 80 // Returns the insets of the client area. | 86 // Returns the insets of the client area. If |restored| is true, this is |
| 81 gfx::Insets GetClientAreaInsets() const; | 87 // calculated as if the window was restored, regardless of its current state. |
| 88 gfx::Insets GetClientAreaInsets(bool restored) const; |
| 82 | 89 |
| 83 // Returns the bounds of the client area for the specified view size. | 90 // Returns the bounds of the client area for the specified view size. |
| 84 gfx::Rect CalculateClientAreaBounds(int width, int height) const; | 91 gfx::Rect CalculateClientAreaBounds(int width, int height) const; |
| 85 | 92 |
| 86 // Starts/Stops the window throbber running. | 93 // Starts/Stops the window throbber running. |
| 87 void StartThrobber(); | 94 void StartThrobber(); |
| 88 void StopThrobber(); | 95 void StopThrobber(); |
| 89 | 96 |
| 90 // Displays the next throbber frame. | 97 // Displays the next throbber frame. |
| 91 void DisplayNextThrobberFrame(); | 98 void DisplayNextThrobberFrame(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 103 int throbber_frame_; | 110 int throbber_frame_; |
| 104 | 111 |
| 105 static const int kThrobberIconCount = 24; | 112 static const int kThrobberIconCount = 24; |
| 106 static HICON throbber_icons_[kThrobberIconCount]; | 113 static HICON throbber_icons_[kThrobberIconCount]; |
| 107 static void InitThrobberIcons(); | 114 static void InitThrobberIcons(); |
| 108 | 115 |
| 109 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); | 116 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); |
| 110 }; | 117 }; |
| 111 | 118 |
| 112 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ | 119 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |