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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_
8 #include "chrome/browser/ui/views/new_avatar_button.h"
9 #include "ui/views/window/non_client_view.h"
12 class AvatarMenuButton;
15 class NewAvatarButton;
17 // A specialization of the NonClientFrameView object that provides additional
18 // Browser-specific methods.
19 class BrowserNonClientFrameView : public views::NonClientFrameView {
21 // Insets around the tabstrip.
22 struct TabStripInsets {
23 TabStripInsets() : top(0), left(0), right(0) {}
24 TabStripInsets(int top, int left, int right)
34 BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view);
35 virtual ~BrowserNonClientFrameView();
37 AvatarMenuButton* avatar_button() const { return avatar_button_; }
39 NewAvatarButton* new_avatar_button() const { return new_avatar_button_; }
41 AvatarLabel* avatar_label() const { return avatar_label_; }
43 // Returns the bounds within which the TabStrip should be laid out.
44 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const = 0;
46 // Returns the TabStripInsets within the window at which the tab strip is
47 // positioned. If |as_restored| is true, this is calculated as if we were in
48 // restored mode regardless of the current mode.
49 virtual TabStripInsets GetTabStripInsets(bool force_restored) const = 0;
51 // Returns the amount that the theme background should be inset.
52 virtual int GetThemeBackgroundXInset() const = 0;
54 // Updates the throbber.
55 virtual void UpdateThrobber(bool running) = 0;
57 // Overriden from views::View.
58 virtual void VisibilityChanged(views::View* starting_from,
59 bool is_visible) OVERRIDE;
60 virtual void OnThemeChanged() OVERRIDE;
63 BrowserView* browser_view() const { return browser_view_; }
64 BrowserFrame* frame() const { return frame_; }
66 // Updates the title and icon of the avatar button.
67 void UpdateAvatarInfo();
69 // Updates the title of the avatar button displayed in the caption area.
70 // The button uses |style| to match the browser window style and notifies
71 // |listener| when it is clicked.
72 void UpdateNewStyleAvatarInfo(views::ButtonListener* listener,
73 const NewAvatarButton::AvatarButtonStyle style);
75 // Anchor and show the ProfileChooser bubble under the avatar button in
77 void ShowProfileChooserViewBubble();
80 // The frame that hosts this view.
83 // The BrowserView hosted within this View.
84 BrowserView* browser_view_;
86 // Menu button that displays that either the incognito icon or the profile
87 // icon. May be NULL for some frame styles.
88 AvatarMenuButton* avatar_button_;
90 // Avatar label that is used for a managed user.
91 AvatarLabel* avatar_label_;
93 // Menu button that displays the name of the active or guest profile.
94 // May be NULL and will not be displayed for off the record profiles.
95 NewAvatarButton* new_avatar_button_;
100 // Provided by a browser_non_client_frame_view_factory_*.cc implementation
101 BrowserNonClientFrameView* CreateBrowserNonClientFrameView(
102 BrowserFrame* frame, BrowserView* browser_view);
104 } // namespace chrome
106 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_