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

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

Issue 1972033002: Simplify some old avatar menu button code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reinstate ash browser test fix Created 4 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_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/shell_observer.h" 10 #include "ash/shell_observer.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // ash::ShellObserver: 67 // ash::ShellObserver:
68 void OnMaximizeModeStarted() override; 68 void OnMaximizeModeStarted() override;
69 void OnMaximizeModeEnded() override; 69 void OnMaximizeModeEnded() override;
70 70
71 // TabIconViewModel: 71 // TabIconViewModel:
72 bool ShouldTabIconViewAnimate() const override; 72 bool ShouldTabIconViewAnimate() const override;
73 gfx::ImageSkia GetFaviconForTabIconView() override; 73 gfx::ImageSkia GetFaviconForTabIconView() override;
74 74
75 protected: 75 protected:
76 // BrowserNonClientFrameView: 76 // BrowserNonClientFrameView:
77 void UpdateAvatar() override; 77 void UpdateProfileIcons() override;
78 78
79 private: 79 private:
80 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); 80 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader);
81 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, 81 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest,
82 NonImmersiveFullscreen); 82 NonImmersiveFullscreen);
83 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, 83 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest,
84 ImmersiveFullscreen); 84 ImmersiveFullscreen);
85 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, 85 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest,
86 ToggleMaximizeModeRelayout); 86 ToggleMaximizeModeRelayout);
87 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest,
88 AvatarDisplayOnTeleportedWindow);
87 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, BackButton); 89 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, BackButton);
88 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, LocationIcon); 90 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, LocationIcon);
89 friend class BrowserHeaderPainterAsh; 91 friend class BrowserHeaderPainterAsh;
90 92
91 // views::NonClientFrameView: 93 // views::NonClientFrameView:
92 bool DoesIntersectRect(const views::View* target, 94 bool DoesIntersectRect(const views::View* target,
93 const gfx::Rect& rect) const override; 95 const gfx::Rect& rect) const override;
94 96
95 // Distance between the left edge of the NonClientFrameView and the tab strip. 97 // Distance between the left edge of the NonClientFrameView and the tab strip.
96 int GetTabStripLeftInset() const; 98 int GetTabStripLeftInset() const;
(...skipping 10 matching lines...) Expand all
107 // Returns true if the header should be painted so that it looks the same as 109 // Returns true if the header should be painted so that it looks the same as
108 // the header used for packaged apps. Packaged apps use a different color 110 // the header used for packaged apps. Packaged apps use a different color
109 // scheme than browser windows. 111 // scheme than browser windows.
110 bool UsePackagedAppHeaderStyle() const; 112 bool UsePackagedAppHeaderStyle() const;
111 113
112 // Returns true if the header should be painted with a WebApp header style. 114 // Returns true if the header should be painted with a WebApp header style.
113 // The WebApp header style has a back button and title along with the usual 115 // The WebApp header style has a back button and title along with the usual
114 // accoutrements. 116 // accoutrements.
115 bool UseWebAppHeaderStyle() const; 117 bool UseWebAppHeaderStyle() const;
116 118
117 // Layout the avatar button. 119 void LayoutProfileIndicatorIcon();
118 void LayoutAvatar();
119 120
120 // Returns true if there is anything to paint. Some fullscreen windows do not 121 // Returns true if there is anything to paint. Some fullscreen windows do not
121 // need their frames painted. 122 // need their frames painted.
122 bool ShouldPaint() const; 123 bool ShouldPaint() const;
123 124
124 void PaintToolbarBackground(gfx::Canvas* canvas); 125 void PaintToolbarBackground(gfx::Canvas* canvas);
125 126
126 // View which contains the window controls. 127 // View which contains the window controls.
127 ash::FrameCaptionButtonContainerView* caption_button_container_; 128 ash::FrameCaptionButtonContainerView* caption_button_container_;
128 129
129 // The holder for the buttons on the left side of the header. This is included 130 // The holder for the buttons on the left side of the header. This is included
130 // for web app style frames, and includes a back button and location icon. 131 // for web app style frames, and includes a back button and location icon.
131 WebAppLeftHeaderView* web_app_left_header_view_; 132 WebAppLeftHeaderView* web_app_left_header_view_;
132 133
133 // For popups, the window icon. 134 // For popups, the window icon.
134 TabIconView* window_icon_; 135 TabIconView* window_icon_;
135 136
136 // Helper class for painting the header. 137 // Helper class for painting the header.
137 std::unique_ptr<ash::HeaderPainter> header_painter_; 138 std::unique_ptr<ash::HeaderPainter> header_painter_;
138 139
139 // Updates the hittest bounds overrides based on the window show type. 140 // Updates the hittest bounds overrides based on the window show type.
140 std::unique_ptr<ash::FrameBorderHitTestController> 141 std::unique_ptr<ash::FrameBorderHitTestController>
141 frame_border_hit_test_controller_; 142 frame_border_hit_test_controller_;
142 143
143 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); 144 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh);
144 }; 145 };
145 146
146 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ 147 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698