Chromium Code Reviews| 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 "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/win/scoped_gdi_object.h" | 10 #include "base/win/scoped_gdi_object.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 void Layout() override; | 45 void Layout() override; |
| 46 | 46 |
| 47 // BrowserNonClientFrameView: | 47 // BrowserNonClientFrameView: |
| 48 void UpdateAvatar() override; | 48 void UpdateAvatar() override; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // views::NonClientFrameView: | 51 // views::NonClientFrameView: |
| 52 bool DoesIntersectRect(const views::View* target, | 52 bool DoesIntersectRect(const views::View* target, |
| 53 const gfx::Rect& rect) const override; | 53 const gfx::Rect& rect) const override; |
| 54 | 54 |
| 55 // Returns the thickness of the border that makes up the window left, right, | 55 // Returns the thickness of the border around the client area (web content, |
| 56 // and bottom frame edges. This does not include any client edge. | 56 // toolbar, and tabs) that separates it from the frame border. If |restored| |
| 57 // is true, this is calculated as if the window was restored, regardless of | |
| 58 // its current state. | |
| 59 int ClientBorderThickness(bool restored) const; | |
| 60 | |
| 61 // Returns the thickness of the window border for the left, right, and bottom | |
| 62 // edges of the frame. On Windows 10 this is a mostly-transparent handle that | |
| 63 // allows you to resize the window. | |
| 57 int FrameBorderThickness() const; | 64 int FrameBorderThickness() const; |
| 58 | 65 |
| 59 // Returns the height of the window top frame edge. If |restored| is true, | 66 // Returns the thickness of the window border for the top edge of the frame, |
| 60 // this is calculated as if the window was restored, regardless of its current | 67 // which is sometimes different than FrameBorderThickness(). Does not include |
| 61 // state. | 68 // the titlebar/tabstrip area. If |restored| is true, this is calculated as if |
| 62 int FrameTopBorderHeight(bool restored) const; | 69 // the window was restored, regardless of its current state. |
| 70 int FrameTopBorderThickness(bool restored) const; | |
| 63 | 71 |
| 64 // Returns the thickness of the entire nonclient left, right, and bottom | 72 // Returns the height of the entire top chrome, from the edge of the window to |
| 65 // borders, including both the window frame and any client edge. If |restored| | 73 // the top of the tabs. If |restored| is true, this is calculated as if the |
|
Peter Kasting
2016/04/19 21:00:00
Nit: Maybe "Returns the height of everything above
Bret
2016/04/19 23:19:47
Ok, I like your comment. Done.
| |
| 66 // is true, this is calculated as if the window was restored, regardless of | 74 // window was restored, regardless of its current state. |
| 67 // its current state. | 75 int TopAreaHeight(bool restored) const; |
| 68 int NonClientBorderThickness(bool restored) const; | |
| 69 | 76 |
| 70 // Returns the height of the entire nonclient top border, including the window | 77 // Returns the y coordinate for the Windows caption buttons. |
| 71 // frame, any title area, and any connected client edge. If |restored| is | 78 int CaptionButtonY() const; |
| 72 // true, this is calculated as if the window was restored, regardless of its | |
| 73 // current state. | |
| 74 int NonClientTopBorderHeight(bool restored) const; | |
| 75 | 79 |
| 76 // Returns whether the toolbar is currently visible. | 80 // Returns whether the toolbar is currently visible. |
| 77 bool IsToolbarVisible() const; | 81 bool IsToolbarVisible() const; |
| 78 | 82 |
| 83 // Returns whether the caption buttons are drawn at the leading edge (i.e. the | |
| 84 // left in LTR mode, or the right in RTL mode). | |
| 85 bool CaptionButtonsOnLeadingEdge() const; | |
| 86 | |
| 79 // Paint various sub-components of this view. | 87 // Paint various sub-components of this view. |
| 80 void PaintToolbarBackground(gfx::Canvas* canvas) const; | 88 void PaintToolbarBackground(gfx::Canvas* canvas) const; |
| 81 void PaintClientEdge(gfx::Canvas* canvas) const; | 89 void PaintClientEdge(gfx::Canvas* canvas) const; |
| 82 void FillClientEdgeRects(int x, | 90 void FillClientEdgeRects(int x, |
| 83 int y, | 91 int y, |
| 84 int right, | 92 int right, |
| 85 int bottom, | 93 int bottom, |
| 86 SkColor color, | 94 SkColor color, |
| 87 gfx::Canvas* canvas) const; | 95 gfx::Canvas* canvas) const; |
| 88 | 96 |
| 89 // Layout various sub-components of this view. | 97 // Layout various sub-components of this view. |
| 90 void LayoutIncognitoIcon(); | 98 void LayoutIncognitoIcon(); |
| 91 void LayoutNewStyleAvatar(); | 99 void LayoutProfileSwitcher(); |
| 92 void LayoutClientView(); | 100 void LayoutClientView(); |
| 93 | 101 |
| 94 // Returns the insets of the client area. If |restored| is true, this is | 102 // Returns the insets of the client area. If |restored| is true, this is |
| 95 // calculated as if the window was restored, regardless of its current state. | 103 // calculated as if the window was restored, regardless of its current state. |
| 96 gfx::Insets GetClientAreaInsets(bool restored) const; | 104 gfx::Insets GetClientAreaInsets(bool restored) const; |
| 97 | 105 |
| 98 // Returns the bounds of the client area for the specified view size. | 106 // Returns the bounds of the client area for the specified view size. |
| 99 gfx::Rect CalculateClientAreaBounds() const; | 107 gfx::Rect CalculateClientAreaBounds() const; |
| 100 | 108 |
| 101 // Starts/Stops the window throbber running. | 109 // Starts/Stops the window throbber running. |
| 102 void StartThrobber(); | 110 void StartThrobber(); |
| 103 void StopThrobber(); | 111 void StopThrobber(); |
| 104 | 112 |
| 105 // Displays the next throbber frame. | 113 // Displays the next throbber frame. |
| 106 void DisplayNextThrobberFrame(); | 114 void DisplayNextThrobberFrame(); |
| 107 | 115 |
| 108 // The layout rect of the incognito icon, if visible. | 116 // The layout rect of the incognito icon, if visible. |
| 109 gfx::Rect incognito_bounds_; | 117 gfx::Rect incognito_bounds_; |
| 110 | 118 |
| 111 // The bounds of the ClientView. | 119 // The bounds of the ClientView. |
| 112 gfx::Rect client_view_bounds_; | 120 gfx::Rect client_view_bounds_; |
| 113 | 121 |
| 114 // The small icon created from the bitmap image of the window icon. | 122 // The small icon created from the bitmap image of the window icon. |
| 115 base::win::ScopedHICON small_window_icon_; | 123 base::win::ScopedHICON small_window_icon_; |
| 116 | 124 |
| 117 // The big icon created from the bitmap image of the window icon. | 125 // The big icon created from the bitmap image of the window icon. |
| 118 base::win::ScopedHICON big_window_icon_; | 126 base::win::ScopedHICON big_window_icon_; |
| 119 | 127 |
| 120 // Wrapper around the in-frame avatar switcher. | 128 // Wrapper around the in-frame profile switcher. |
| 121 AvatarButtonManager profile_switcher_; | 129 AvatarButtonManager profile_switcher_; |
| 122 | 130 |
| 123 // Whether or not the window throbber is currently animating. | 131 // Whether or not the window throbber is currently animating. |
| 124 bool throbber_running_; | 132 bool throbber_running_; |
| 125 | 133 |
| 126 // The index of the current frame of the throbber animation. | 134 // The index of the current frame of the throbber animation. |
| 127 int throbber_frame_; | 135 int throbber_frame_; |
| 128 | 136 |
| 129 static const int kThrobberIconCount = 24; | 137 static const int kThrobberIconCount = 24; |
| 130 static HICON throbber_icons_[kThrobberIconCount]; | 138 static HICON throbber_icons_[kThrobberIconCount]; |
| 131 static void InitThrobberIcons(); | 139 static void InitThrobberIcons(); |
| 132 | 140 |
| 133 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); | 141 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); |
| 134 }; | 142 }; |
| 135 | 143 |
| 136 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ | 144 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |