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

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

Issue 1608843002: Start untangling the avatar switcher from BrowserNonClientFrameView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160119-MacViewsBrowser-Compile
Patch Set: rename, enum class Created 4 years, 11 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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/frame/avatar_button_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/avatar_button_manager.h
diff --git a/chrome/browser/ui/views/frame/avatar_button_manager.h b/chrome/browser/ui/views/frame/avatar_button_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..76f71561ee39a2dc2eca4450f8e485c8933a3b4d
--- /dev/null
+++ b/chrome/browser/ui/views/frame/avatar_button_manager.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_AVATAR_BUTTON_MANAGER_H_
+#define CHROME_BROWSER_UI_VIEWS_FRAME_AVATAR_BUTTON_MANAGER_H_
+
+#include "chrome/browser/ui/views/profiles/avatar_button_style.h"
+#include "ui/views/controls/button/button.h"
+
+class BrowserNonClientFrameView;
+
+// Manages an avatar button displayed in a browser frame. The button displays
+// the name of the active or guest profile, and may be null.
+class AvatarButtonManager : public views::ButtonListener {
+ public:
+ explicit AvatarButtonManager(BrowserNonClientFrameView* frame_view);
+
+ // Adds or removes the avatar button from the frame, based on the BrowserView
+ // properties.
+ void Update(AvatarButtonStyle style);
+
+ // Gets the avatar button as a view::View.
+ views::View* view() const { return view_; }
+
+ private:
+ // views::ButtonListener:
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+
+ BrowserNonClientFrameView* frame_view_; // Weak. Owns |this|.
+
+ // Menu button that displays the name of the active or guest profile.
+ // May be null and will not be displayed for off the record profiles.
+ views::View* view_; // Owned by views hierarchy.
+
+ DISALLOW_COPY_AND_ASSIGN(AvatarButtonManager);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_FRAME_AVATAR_BUTTON_MANAGER_H_
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/frame/avatar_button_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698