OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ | 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_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ |
7 | 7 |
8 #include "chrome/browser/ui/views/profiles/new_avatar_button.h" | 8 #include "chrome/browser/ui/views/profiles/new_avatar_button.h" |
9 #include "ui/views/window/non_client_view.h" | 9 #include "ui/views/window/non_client_view.h" |
10 | 10 |
11 #if defined(ENABLE_MANAGED_USERS) | 11 #if defined(ENABLE_MANAGED_USERS) |
12 class SupervisedUserAvatarLabel; | 12 class SupervisedUserAvatarLabel; |
13 #endif | 13 #endif |
14 class AvatarMenuButton; | 14 class AvatarMenuButton; |
15 class BrowserFrame; | 15 class BrowserFrame; |
16 class BrowserView; | 16 class BrowserView; |
17 class NewAvatarButton; | 17 class NewAvatarButton; |
18 | 18 |
19 // A specialization of the NonClientFrameView object that provides additional | 19 // A specialization of the NonClientFrameView object that provides additional |
20 // Browser-specific methods. | 20 // Browser-specific methods. |
21 class BrowserNonClientFrameView : public views::NonClientFrameView, | 21 class BrowserNonClientFrameView : public views::NonClientFrameView, |
22 public ProfileInfoCacheObserver { | 22 public ProfileInfoCacheObserver { |
23 public: | 23 public: |
24 BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view); | 24 BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view); |
25 virtual ~BrowserNonClientFrameView(); | 25 ~BrowserNonClientFrameView() override; |
26 | 26 |
27 AvatarMenuButton* avatar_button() const { return avatar_button_; } | 27 AvatarMenuButton* avatar_button() const { return avatar_button_; } |
28 | 28 |
29 NewAvatarButton* new_avatar_button() const { return new_avatar_button_; } | 29 NewAvatarButton* new_avatar_button() const { return new_avatar_button_; } |
30 | 30 |
31 #if defined(ENABLE_MANAGED_USERS) | 31 #if defined(ENABLE_MANAGED_USERS) |
32 SupervisedUserAvatarLabel* supervised_user_avatar_label() const { | 32 SupervisedUserAvatarLabel* supervised_user_avatar_label() const { |
33 return supervised_user_avatar_label_; | 33 return supervised_user_avatar_label_; |
34 } | 34 } |
35 | 35 |
36 virtual void OnThemeChanged() override; | 36 void OnThemeChanged() override; |
37 #endif | 37 #endif |
38 | 38 |
39 // Retrieves the bounds, in non-client view coordinates within which the | 39 // Retrieves the bounds, in non-client view coordinates within which the |
40 // TabStrip should be laid out. | 40 // TabStrip should be laid out. |
41 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const = 0; | 41 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const = 0; |
42 | 42 |
43 // Returns the inset of the topmost view in the client view from the top of | 43 // Returns the inset of the topmost view in the client view from the top of |
44 // the non-client view. The topmost view depends on the window type. The | 44 // the non-client view. The topmost view depends on the window type. The |
45 // topmost view is the tab strip for tabbed browser windows, the toolbar for | 45 // topmost view is the tab strip for tabbed browser windows, the toolbar for |
46 // popups, the web contents for app windows and varies for fullscreen windows. | 46 // popups, the web contents for app windows and varies for fullscreen windows. |
47 virtual int GetTopInset() const = 0; | 47 virtual int GetTopInset() const = 0; |
48 | 48 |
49 // Returns the amount that the theme background should be inset. | 49 // Returns the amount that the theme background should be inset. |
50 virtual int GetThemeBackgroundXInset() const = 0; | 50 virtual int GetThemeBackgroundXInset() const = 0; |
51 | 51 |
52 // Updates the throbber. | 52 // Updates the throbber. |
53 virtual void UpdateThrobber(bool running) = 0; | 53 virtual void UpdateThrobber(bool running) = 0; |
54 | 54 |
55 // Overriden from views::View. | 55 // Overriden from views::View. |
56 virtual void VisibilityChanged(views::View* starting_from, | 56 void VisibilityChanged(views::View* starting_from, bool is_visible) override; |
57 bool is_visible) override; | |
58 | 57 |
59 protected: | 58 protected: |
60 BrowserView* browser_view() const { return browser_view_; } | 59 BrowserView* browser_view() const { return browser_view_; } |
61 BrowserFrame* frame() const { return frame_; } | 60 BrowserFrame* frame() const { return frame_; } |
62 | 61 |
63 // Updates the title and icon of the avatar button. | 62 // Updates the title and icon of the avatar button. |
64 void UpdateAvatarInfo(); | 63 void UpdateAvatarInfo(); |
65 | 64 |
66 // Updates the title of the avatar button displayed in the caption area. | 65 // Updates the title of the avatar button displayed in the caption area. |
67 // The button uses |style| to match the browser window style and notifies | 66 // The button uses |style| to match the browser window style and notifies |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 98 |
100 namespace chrome { | 99 namespace chrome { |
101 | 100 |
102 // Provided by a browser_non_client_frame_view_factory_*.cc implementation | 101 // Provided by a browser_non_client_frame_view_factory_*.cc implementation |
103 BrowserNonClientFrameView* CreateBrowserNonClientFrameView( | 102 BrowserNonClientFrameView* CreateBrowserNonClientFrameView( |
104 BrowserFrame* frame, BrowserView* browser_view); | 103 BrowserFrame* frame, BrowserView* browser_view); |
105 | 104 |
106 } // namespace chrome | 105 } // namespace chrome |
107 | 106 |
108 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ | 107 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ |
OLD | NEW |