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

Unified Diff: chrome/browser/ui/views/profiles/avatar_button.h

Issue 2880033003: Apply MD style to Linux avatar buttons. (Closed)
Patch Set: tweaks 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/profiles/avatar_button.h
diff --git a/chrome/browser/ui/views/profiles/avatar_button.h b/chrome/browser/ui/views/profiles/avatar_button.h
index f17cea305e6910ce00242c2266a974e209bb59ac..e366139c1acf84adfb6f9d12e2e1542bce809e4f 100644
--- a/chrome/browser/ui/views/profiles/avatar_button.h
+++ b/chrome/browser/ui/views/profiles/avatar_button.h
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/avatar_button_error_controller_delegate.h"
#include "chrome/browser/ui/views/profiles/avatar_button_style.h"
#include "ui/views/controls/button/label_button.h"
+#include "ui/views/widget/widget_observer.h"
class Profile;
@@ -19,7 +20,8 @@ class Profile;
// caption area.
class AvatarButton : public views::LabelButton,
public AvatarButtonErrorControllerDelegate,
- public ProfileAttributesStorage::Observer {
+ public ProfileAttributesStorage::Observer,
+ public views::WidgetObserver {
public:
AvatarButton(views::ButtonListener* listener,
AvatarButtonStyle button_style,
@@ -32,6 +34,8 @@ class AvatarButton : public views::LabelButton,
gfx::Size GetPreferredSize() const override;
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
const override;
+ std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override;
+ void NotifyClick(const ui::Event& event) override;
protected:
// views::LabelButton:
@@ -52,6 +56,9 @@ class AvatarButton : public views::LabelButton,
void OnProfileSupervisedUserIdChanged(
const base::FilePath& profile_path) override;
+ // views::WidgetObserver
Peter Kasting 2017/05/15 21:51:28 Nit: Trailing colon
+ void OnWidgetClosing(views::Widget* widget) override;
+
// Called when the profile info cache or signin/sync error has changed, which
// means we might have to update the icon/text of the button.
void Update();
@@ -59,6 +66,10 @@ class AvatarButton : public views::LabelButton,
// Sets generic_avatar_ to the image with the specified IDR.
void SetButtonAvatar(int avatar_idr);
+ // Returns true when the button can get smaller to accomodate a more crowded
+ // browser frame.
+ bool IsCondensible() const;
+
AvatarButtonErrorController error_controller_;
Profile* profile_;
ScopedObserver<ProfileAttributesStorage, AvatarButton> profile_observer_;
@@ -67,10 +78,7 @@ class AvatarButton : public views::LabelButton,
// Different assets are used depending on the OS version.
gfx::ImageSkia generic_avatar_;
- // True to use the Windows 10 native (non-themed) button, which is drawn using
- // a vector icon and can change height to slide atop the tabstrip. False to
- // use the old PNG, fixed-size icon button or a themed button.
- bool use_win10_native_button_;
+ AvatarButtonStyle button_style_;
DISALLOW_COPY_AND_ASSIGN(AvatarButton);
};

Powered by Google App Engine
This is Rietveld 408576698