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

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

Issue 2832823002: Update avatar button to MD (Closed)
Patch Set: Fix for --force-device-scale-factor, vector icon, review comments Created 3 years, 7 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"
11 #include "chrome/browser/ui/views/frame/avatar_button_manager.h" 11 #include "chrome/browser/ui/views/frame/avatar_button_manager.h"
12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" 12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
13 #include "chrome/browser/ui/views/frame/windows_10_caption_button.h" 13 #include "chrome/browser/ui/views/frame/windows_10_caption_button.h"
14 #include "chrome/browser/ui/views/tab_icon_view.h" 14 #include "chrome/browser/ui/views/tab_icon_view.h"
15 #include "chrome/browser/ui/views/tab_icon_view_model.h" 15 #include "chrome/browser/ui/views/tab_icon_view_model.h"
16 #include "chrome/browser/ui/views/tabs/tab_strip.h"
17 #include "chrome/browser/ui/views/tabs/tab_strip_observer.h"
16 #include "ui/views/controls/button/button.h" 18 #include "ui/views/controls/button/button.h"
17 #include "ui/views/window/non_client_view.h" 19 #include "ui/views/window/non_client_view.h"
18 20
19 class BrowserView; 21 class BrowserView;
20 22
21 class GlassBrowserFrameView : public BrowserNonClientFrameView, 23 class GlassBrowserFrameView : public BrowserNonClientFrameView,
22 public views::ButtonListener, 24 public views::ButtonListener,
23 public TabIconViewModel { 25 public TabIconViewModel,
26 public TabStripObserver {
24 public: 27 public:
25 // Constructs a non-client view for an BrowserFrame. 28 // Constructs a non-client view for an BrowserFrame.
26 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); 29 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view);
27 ~GlassBrowserFrameView() override; 30 ~GlassBrowserFrameView() override;
28 31
29 // BrowserNonClientFrameView: 32 // BrowserNonClientFrameView:
30 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; 33 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override;
31 int GetTopInset(bool restored) const override; 34 int GetTopInset(bool restored) const override;
32 int GetThemeBackgroundXInset() const override; 35 int GetThemeBackgroundXInset() const override;
33 void UpdateThrobber(bool running) override; 36 void UpdateThrobber(bool running) override;
34 gfx::Size GetMinimumSize() const override; 37 gfx::Size GetMinimumSize() const override;
35 views::View* GetProfileSwitcherView() const override; 38 views::MenuButton* GetProfileSwitcherButton() const override;
39 void OnBrowserViewInitViewsComplete() override;
36 40
37 // views::NonClientFrameView: 41 // views::NonClientFrameView:
38 gfx::Rect GetBoundsForClientView() const override; 42 gfx::Rect GetBoundsForClientView() const override;
39 gfx::Rect GetWindowBoundsForClientBounds( 43 gfx::Rect GetWindowBoundsForClientBounds(
40 const gfx::Rect& client_bounds) const override; 44 const gfx::Rect& client_bounds) const override;
41 int NonClientHitTest(const gfx::Point& point) override; 45 int NonClientHitTest(const gfx::Point& point) override;
42 void UpdateWindowIcon() override; 46 void UpdateWindowIcon() override;
43 void UpdateWindowTitle() override; 47 void UpdateWindowTitle() override;
44 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {} 48 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {}
45 void ResetWindowControls() override {} 49 void ResetWindowControls() override {}
(...skipping 20 matching lines...) Expand all
66 void Layout() override; 70 void Layout() override;
67 71
68 // BrowserNonClientFrameView: 72 // BrowserNonClientFrameView:
69 void UpdateProfileIcons() override; 73 void UpdateProfileIcons() override;
70 74
71 private: 75 private:
72 // views::NonClientFrameView: 76 // views::NonClientFrameView:
73 bool DoesIntersectRect(const views::View* target, 77 bool DoesIntersectRect(const views::View* target,
74 const gfx::Rect& rect) const override; 78 const gfx::Rect& rect) const override;
75 79
80 // TabStripObserver:
81 void TabStripMaxXChanged(TabStrip* tab_strip) override;
82 void TabStripDeleted(TabStrip* tab_strip) override;
83 void TabStripRemovedTabAt(TabStrip* tab_strip, int index) override;
84
76 // Returns the thickness of the border around the client area (web content, 85 // Returns the thickness of the border around the client area (web content,
77 // toolbar, and tabs) that separates it from the frame border. If |restored| 86 // toolbar, and tabs) that separates it from the frame border. If |restored|
78 // is true, this is calculated as if the window was restored, regardless of 87 // is true, this is calculated as if the window was restored, regardless of
79 // its current state. 88 // its current state.
80 int ClientBorderThickness(bool restored) const; 89 int ClientBorderThickness(bool restored) const;
81 90
82 // Returns the thickness of the window border for the left, right, and bottom 91 // Returns the thickness of the window border for the left, right, and bottom
83 // edges of the frame. On Windows 10 this is a mostly-transparent handle that 92 // edges of the frame. On Windows 10 this is a mostly-transparent handle that
84 // allows you to resize the window. 93 // allows you to resize the window.
85 int FrameBorderThickness() const; 94 int FrameBorderThickness() const;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Returns the bounds of the client area for the specified view size. 160 // Returns the bounds of the client area for the specified view size.
152 gfx::Rect CalculateClientAreaBounds() const; 161 gfx::Rect CalculateClientAreaBounds() const;
153 162
154 // Starts/Stops the window throbber running. 163 // Starts/Stops the window throbber running.
155 void StartThrobber(); 164 void StartThrobber();
156 void StopThrobber(); 165 void StopThrobber();
157 166
158 // Displays the next throbber frame. 167 // Displays the next throbber frame.
159 void DisplayNextThrobberFrame(); 168 void DisplayNextThrobberFrame();
160 169
170 // If --force-device-scale-factor is specified adjusts the specified height,
171 // so that when it is scaled to the forced factor the result is the same as
172 // without the forced scaling.
173 void AdjustForForcedDisplayScaleFactor(int* height) const;
174
161 // The layout rect of the incognito icon, if visible. 175 // The layout rect of the incognito icon, if visible.
162 gfx::Rect incognito_bounds_; 176 gfx::Rect incognito_bounds_;
163 177
164 // The bounds of the ClientView. 178 // The bounds of the ClientView.
165 gfx::Rect client_view_bounds_; 179 gfx::Rect client_view_bounds_;
166 180
167 // The small icon created from the bitmap image of the window icon. 181 // The small icon created from the bitmap image of the window icon.
168 base::win::ScopedHICON small_window_icon_; 182 base::win::ScopedHICON small_window_icon_;
169 183
170 // The big icon created from the bitmap image of the window icon. 184 // The big icon created from the bitmap image of the window icon.
(...skipping 11 matching lines...) Expand all
182 Windows10CaptionButton* maximize_button_; 196 Windows10CaptionButton* maximize_button_;
183 Windows10CaptionButton* restore_button_; 197 Windows10CaptionButton* restore_button_;
184 Windows10CaptionButton* close_button_; 198 Windows10CaptionButton* close_button_;
185 199
186 // Whether or not the window throbber is currently animating. 200 // Whether or not the window throbber is currently animating.
187 bool throbber_running_; 201 bool throbber_running_;
188 202
189 // The index of the current frame of the throbber animation. 203 // The index of the current frame of the throbber animation.
190 int throbber_frame_; 204 int throbber_frame_;
191 205
206 // Tab strip to watch for changes to resize the avatar button.
207 TabStrip* tab_strip_;
208
192 static const int kThrobberIconCount = 24; 209 static const int kThrobberIconCount = 24;
193 static HICON throbber_icons_[kThrobberIconCount]; 210 static HICON throbber_icons_[kThrobberIconCount];
194 static void InitThrobberIcons(); 211 static void InitThrobberIcons();
195 212
196 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); 213 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView);
197 }; 214 };
198 215
199 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ 216 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698