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

Side by Side Diff: chrome/browser/ui/views/frame/avatar_button_bridge.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: various selfnits 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_AVATAR_BUTTON_BRIDGE_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_AVATAR_BUTTON_BRIDGE_H_
7
8 #include "chrome/browser/ui/views/profiles/avatar_button_style.h"
9 #include "ui/views/controls/button/button.h"
10
11 class BrowserNonClientFrameView;
12
13 // Wrapper for an avatar button displayed in a browser frame. The button
14 // displays the name of the active or guest profile, and may be null.
15 class AvatarButtonBridge : public views::ButtonListener {
sky 2016/01/20 17:05:36 I'm curious why you're naming this with bridge. It
tapted 2016/01/21 01:33:21 Yeah - Bridge doesn't really fit. I've gone with A
16 public:
17 explicit AvatarButtonBridge(BrowserNonClientFrameView* frame_view);
18
19 // Adds or removes the avatar button from the frame, based on the BrowserView
20 // properties.
21 void Update(AvatarButtonStyle style);
22
23 // Gets the avatar button as a view::View.
24 views::View* view() const { return view_; }
25
26 private:
27 // views::ButtonListener:
28 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
29
30 BrowserNonClientFrameView* frame_view_; // Weak. Owns |this|.
31
32 // Menu button that displays the name of the active or guest profile.
33 // May be null and will not be displayed for off the record profiles.
34 views::View* view_; // Owned by views hierarchy.
35
36 DISALLOW_COPY_AND_ASSIGN(AvatarButtonBridge);
37 };
38
39 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_AVATAR_BUTTON_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698