Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1137)

Side by Side Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.h

Issue 1869163003: Refactored GlassBrowserFrameView and BrowserDesktopTreeHostWin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed ananta's comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 window border for the left, right, and bottom
56 // and bottom frame edges. This does not include any client edge. 56 // edges of the frame. On Windows 10 this is a mostly-transparent handle that
57 int FrameBorderThickness() const; 57 // allows you to resize the window.
58 int NonClientBorderThickness() const;
Peter Kasting 2016/04/12 01:49:31 Note: For all these functions you're renaming, con
Bret 2016/04/12 23:19:38 I took a look at these. It seems like Ash/Mus are
58 59
59 // Returns the height of the window top frame edge. If |restored| is true, 60 // 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 61 // which is sometimes different than NonClientBorderThickness(). Does not
61 // state. 62 // include the titlebar/tabstrip area. If |restored| is true, this is
62 int FrameTopBorderHeight(bool restored) const; 63 // calculated as if the window was restored, regardless of its current state.
64 int NonClientTopBorderThickness(bool restored) const;
63 65
64 // Returns the thickness of the entire nonclient left, right, and bottom 66 // Returns the thickness of the border around the client area that separates
65 // borders, including both the window frame and any client edge. If |restored| 67 // it from the non-client area. If |restored| is true, this is calculated as
66 // is true, this is calculated as if the window was restored, regardless of 68 // if the window was restored, regardless of its current state.
67 // its current state. 69 int ClientBorderThickness(bool restored) const;
Peter Kasting 2016/04/12 01:49:31 Nit: I might place this above the NonClientXXX() f
Bret 2016/04/12 23:19:38 ClientBorderThickness is only sort of related to N
Peter Kasting 2016/04/13 01:00:22 Maybe it's the NonClient functions which have poor
Bret 2016/04/13 22:19:47 Before I spend a bunch of time thinking about thes
68 int NonClientBorderThickness(bool restored) const;
69 70
70 // Returns the height of the entire nonclient top border, including the window 71 // Returns the height of the entire nonclient top border, from the edge of the
71 // frame, any title area, and any connected client edge. If |restored| is 72 // window to the top of the tabs. If |restored| is true, this is calculated as
72 // true, this is calculated as if the window was restored, regardless of its 73 // if the window was restored, regardless of its current state.
73 // current state. 74 int NonClientTopHeight(bool restored) const;
Peter Kasting 2016/04/12 01:49:31 Nit: I might place this just below NonClientTopBor
Bret 2016/04/12 23:19:38 Done.
74 int NonClientTopBorderHeight(bool restored) const;
75 75
76 // Returns whether the toolbar is currently visible. 76 // Returns whether the toolbar is currently visible.
77 bool IsToolbarVisible() const; 77 bool IsToolbarVisible() const;
78 78
79 // Returns whether we should use the special layout for when the caption
80 // buttons are drawn at the top-right corner in RTL mode.
81 bool RTLSpecialLayout() const;
Peter Kasting 2016/04/12 01:49:31 "Special layout" is kind of vague. If this is spe
Bret 2016/04/12 23:19:38 Hmm I like having a comment on it even if it's a s
Peter Kasting 2016/04/13 01:00:22 That implies we have two RTL mode states: caption
Bret 2016/04/13 22:19:47 You're correct that at this moment they're on alwa
Peter Kasting 2016/04/15 00:20:51 Note that once you're custom-drawing them on the l
82
83 // Returns the y coordinate for an element that's aligned as far towards the
84 // top of the window as it should be allowed to draw.
85 int WindowTopY() const;
Peter Kasting 2016/04/12 01:49:31 Nit: I would place this next to the other XXXTopXX
Bret 2016/04/12 23:19:38 Done.
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 LayoutAvatar();
Peter Kasting 2016/04/12 01:49:31 Nit: If we're going to rename this, maybe we shoul
Bret 2016/04/12 23:19:38 Done for references in this class. There are a bun
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.
(...skipping 25 matching lines...) Expand all
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698