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

Unified Diff: chrome/browser/ui/views/frame/glass_browser_frame_view.h

Issue 2851543002: Update avatar button to MD (part 1) (Closed)
Patch Set: Merged ThemedAvatarButton and Win10NativeAvatarButton into the base AvatarButton class 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/glass_browser_frame_view.h
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.h b/chrome/browser/ui/views/frame/glass_browser_frame_view.h
index 8b0ad07cd6475aa4dbbeb5512a5421fd3060b860..cff465bb4ca22d4609685cf910d403d9275a4126 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.h
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.h
@@ -13,6 +13,8 @@
#include "chrome/browser/ui/views/frame/windows_10_caption_button.h"
#include "chrome/browser/ui/views/tab_icon_view.h"
#include "chrome/browser/ui/views/tab_icon_view_model.h"
+#include "chrome/browser/ui/views/tabs/tab_strip.h"
+#include "chrome/browser/ui/views/tabs/tab_strip_observer.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/window/non_client_view.h"
@@ -20,7 +22,8 @@ class BrowserView;
class GlassBrowserFrameView : public BrowserNonClientFrameView,
public views::ButtonListener,
- public TabIconViewModel {
+ public TabIconViewModel,
+ public TabStripObserver {
public:
// Constructs a non-client view for an BrowserFrame.
GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view);
@@ -33,6 +36,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView,
void UpdateThrobber(bool running) override;
gfx::Size GetMinimumSize() const override;
views::View* GetProfileSwitcherView() const override;
+ void OnBrowserViewInitViewsComplete() override;
// views::NonClientFrameView:
gfx::Rect GetBoundsForClientView() const override;
@@ -64,6 +68,7 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView,
// views::View:
void OnPaint(gfx::Canvas* canvas) override;
void Layout() override;
+ void ChildPreferredSizeChanged(views::View* child) override;
// BrowserNonClientFrameView:
void UpdateProfileIcons() override;
@@ -73,6 +78,11 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView,
bool DoesIntersectRect(const views::View* target,
const gfx::Rect& rect) const override;
+ // TabStripObserver:
Peter Kasting 2017/05/06 02:23:08 Per recent discussion on chromium-dev, overrides s
emx 2017/05/09 16:26:52 Done.
+ void TabStripMaxXChanged(TabStrip* tab_strip) override;
+ void TabStripDeleted(TabStrip* tab_strip) override;
+ void TabStripRemovedTabAt(TabStrip* tab_strip, int index) override;
+
// Returns the thickness of the border around the client area (web content,
// toolbar, and tabs) that separates it from the frame border. If |restored|
// is true, this is calculated as if the window was restored, regardless of
@@ -189,6 +199,9 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView,
// The index of the current frame of the throbber animation.
int throbber_frame_;
+ // Tab strip to watch for changes to resize the avatar button.
Peter Kasting 2017/05/06 02:23:08 Nit: "The window's tabstrip, if any. Observed so
emx 2017/05/09 16:26:51 Done.
+ TabStrip* tab_strip_;
+
static const int kThrobberIconCount = 24;
static HICON throbber_icons_[kThrobberIconCount];
static void InitThrobberIcons();

Powered by Google App Engine
This is Rietveld 408576698