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/profiles/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 BrowserNonClientFrameView(BrowserFrame
* frame
, BrowserView
* browser_view
);
22 virtual ~BrowserNonClientFrameView();
24 AvatarMenuButton
* avatar_button() const { return avatar_button_
; }
26 NewAvatarButton
* new_avatar_button() const { return new_avatar_button_
; }
28 AvatarLabel
* avatar_label() const { return avatar_label_
; }
30 // Retrieves the bounds, in non-client view coordinates within which the
31 // TabStrip should be laid out.
32 virtual gfx::Rect
GetBoundsForTabStrip(views::View
* tabstrip
) const = 0;
34 // Returns the inset of the topmost view in the client view from the top of
35 // the non-client view. The topmost view depends on the window type. The
36 // topmost view is the tab strip for tabbed browser windows, the toolbar for
37 // popups, the web contents for app windows and varies for fullscreen windows.
38 virtual int GetTopInset() const = 0;
40 // Returns the amount that the theme background should be inset.
41 virtual int GetThemeBackgroundXInset() const = 0;
43 // Updates the throbber.
44 virtual void UpdateThrobber(bool running
) = 0;
46 // Overriden from views::View.
47 virtual void VisibilityChanged(views::View
* starting_from
,
48 bool is_visible
) OVERRIDE
;
49 virtual void OnThemeChanged() OVERRIDE
;
52 BrowserView
* browser_view() const { return browser_view_
; }
53 BrowserFrame
* frame() const { return frame_
; }
55 // Updates the title and icon of the avatar button.
56 void UpdateAvatarInfo();
58 // Updates the title of the avatar button displayed in the caption area.
59 // The button uses |style| to match the browser window style and notifies
60 // |listener| when it is clicked.
61 void UpdateNewStyleAvatarInfo(views::ButtonListener
* listener
,
62 const NewAvatarButton::AvatarButtonStyle style
);
65 // The frame that hosts this view.
68 // The BrowserView hosted within this View.
69 BrowserView
* browser_view_
;
71 // Menu button that displays that either the incognito icon or the profile
72 // icon. May be NULL for some frame styles.
73 AvatarMenuButton
* avatar_button_
;
75 // Avatar label that is used for a managed user.
76 AvatarLabel
* avatar_label_
;
78 // Menu button that displays the name of the active or guest profile.
79 // May be NULL and will not be displayed for off the record profiles.
80 NewAvatarButton
* new_avatar_button_
;
85 // Provided by a browser_non_client_frame_view_factory_*.cc implementation
86 BrowserNonClientFrameView
* CreateBrowserNonClientFrameView(
87 BrowserFrame
* frame
, BrowserView
* browser_view
);
91 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_