Chromium Code Reviews| 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 "ui/views/window/non_client_view.h" | 8 #include "ui/views/window/non_client_view.h" |
| 9 | 9 |
| 10 class AvatarLabel; | 10 class AvatarLabel; |
| 11 class AvatarMenuButton; | 11 class AvatarMenuButton; |
| 12 class BrowserFrame; | 12 class BrowserFrame; |
| 13 class BrowserView; | 13 class BrowserView; |
| 14 class NewAvatarButton; | |
| 14 | 15 |
| 15 // A specialization of the NonClientFrameView object that provides additional | 16 // A specialization of the NonClientFrameView object that provides additional |
| 16 // Browser-specific methods. | 17 // Browser-specific methods. |
| 17 class BrowserNonClientFrameView : public views::NonClientFrameView { | 18 class BrowserNonClientFrameView : public views::NonClientFrameView { |
| 18 public: | 19 public: |
| 19 // Insets around the tabstrip. | 20 // Insets around the tabstrip. |
| 20 struct TabStripInsets { | 21 struct TabStripInsets { |
| 21 TabStripInsets() : top(0), left(0), right(0) {} | 22 TabStripInsets() : top(0), left(0), right(0) {} |
| 22 TabStripInsets(int top, int left, int right) | 23 TabStripInsets(int top, int left, int right) |
| 23 : top(top), | 24 : top(top), |
| 24 left(left), | 25 left(left), |
| 25 right(right) {} | 26 right(right) {} |
| 26 | 27 |
| 27 int top; | 28 int top; |
| 28 int left; | 29 int left; |
| 29 int right; | 30 int right; |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view); | 33 BrowserNonClientFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 33 virtual ~BrowserNonClientFrameView(); | 34 virtual ~BrowserNonClientFrameView(); |
| 34 | 35 |
| 35 AvatarMenuButton* avatar_button() const { return avatar_button_; } | 36 AvatarMenuButton* avatar_button() const { return avatar_button_; } |
| 36 | 37 |
| 38 NewAvatarButton* new_avatar_button() const { return new_avatar_button_; } | |
|
sky
2013/10/03 23:23:11
This is a bit pattern. Return value here should ma
noms (inactive)
2013/10/07 21:18:15
Eek, I'm not sure I can. This seems to be a patter
sky
2013/10/08 01:56:04
Yes, make a bug for it.
noms (inactive)
2013/10/08 18:21:15
Done.
| |
| 39 | |
| 37 AvatarLabel* avatar_label() const { return avatar_label_; } | 40 AvatarLabel* avatar_label() const { return avatar_label_; } |
| 38 | 41 |
| 39 // Returns the bounds within which the TabStrip should be laid out. | 42 // Returns the bounds within which the TabStrip should be laid out. |
| 40 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const = 0; | 43 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const = 0; |
| 41 | 44 |
| 42 // Returns the TabStripInsets within the window at which the tab strip is | 45 // Returns the TabStripInsets within the window at which the tab strip is |
| 43 // positioned. If |as_restored| is true, this is calculated as if we were in | 46 // positioned. If |as_restored| is true, this is calculated as if we were in |
| 44 // restored mode regardless of the current mode. | 47 // restored mode regardless of the current mode. |
| 45 virtual TabStripInsets GetTabStripInsets(bool force_restored) const = 0; | 48 virtual TabStripInsets GetTabStripInsets(bool force_restored) const = 0; |
| 46 | 49 |
| 47 // Returns the amount that the theme background should be inset. | 50 // Returns the amount that the theme background should be inset. |
| 48 virtual int GetThemeBackgroundXInset() const = 0; | 51 virtual int GetThemeBackgroundXInset() const = 0; |
| 49 | 52 |
| 50 // Updates the throbber. | 53 // Updates the throbber. |
| 51 virtual void UpdateThrobber(bool running) = 0; | 54 virtual void UpdateThrobber(bool running) = 0; |
| 52 | 55 |
| 53 // Overriden from views::View. | 56 // Overriden from views::View. |
| 54 virtual void VisibilityChanged(views::View* starting_from, | 57 virtual void VisibilityChanged(views::View* starting_from, |
| 55 bool is_visible) OVERRIDE; | 58 bool is_visible) OVERRIDE; |
| 56 virtual void OnThemeChanged() OVERRIDE; | 59 virtual void OnThemeChanged() OVERRIDE; |
| 57 | 60 |
| 58 protected: | 61 protected: |
| 59 BrowserView* browser_view() const { return browser_view_; } | 62 BrowserView* browser_view() const { return browser_view_; } |
| 60 BrowserFrame* frame() const { return frame_; } | 63 BrowserFrame* frame() const { return frame_; } |
| 61 | 64 |
| 62 // Updates the title and icon of the avatar button. | 65 // Updates the title and icon of the avatar button. |
| 63 void UpdateAvatarInfo(); | 66 void UpdateAvatarInfo(); |
| 67 // Updates the title of the avatar button displayed in the caption area. | |
|
sky
2013/10/03 23:23:11
nit: newline betwten 66/67.
noms (inactive)
2013/10/07 21:18:15
Done.
| |
| 68 void UpdateNewStyleAvatarInfo(); | |
| 64 | 69 |
| 65 private: | 70 private: |
| 66 // The frame that hosts this view. | 71 // The frame that hosts this view. |
| 67 BrowserFrame* frame_; | 72 BrowserFrame* frame_; |
| 68 | 73 |
| 69 // The BrowserView hosted within this View. | 74 // The BrowserView hosted within this View. |
| 70 BrowserView* browser_view_; | 75 BrowserView* browser_view_; |
| 71 | 76 |
| 72 // Menu button that displays that either the incognito icon or the profile | 77 // Menu button that displays that either the incognito icon or the profile |
| 73 // icon. May be NULL for some frame styles. | 78 // icon. May be NULL for some frame styles. |
| 74 AvatarMenuButton* avatar_button_; | 79 AvatarMenuButton* avatar_button_; |
| 75 | 80 |
| 76 // Avatar label that is used for a managed user. | 81 // Avatar label that is used for a managed user. |
| 77 AvatarLabel* avatar_label_; | 82 AvatarLabel* avatar_label_; |
| 83 | |
| 84 // Menu button that displays the name of the active or guest profile. | |
| 85 // May be NULL and will not be displayed for off the record profiles. | |
| 86 NewAvatarButton* new_avatar_button_; | |
| 78 }; | 87 }; |
| 79 | 88 |
| 80 namespace chrome { | 89 namespace chrome { |
| 81 | 90 |
| 82 // Provided by a browser_non_client_frame_view_factory_*.cc implementation | 91 // Provided by a browser_non_client_frame_view_factory_*.cc implementation |
| 83 BrowserNonClientFrameView* CreateBrowserNonClientFrameView( | 92 BrowserNonClientFrameView* CreateBrowserNonClientFrameView( |
| 84 BrowserFrame* frame, BrowserView* browser_view); | 93 BrowserFrame* frame, BrowserView* browser_view); |
| 85 | 94 |
| 86 } // namespace chrome | 95 } // namespace chrome |
| 87 | 96 |
| 88 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ | 97 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_H_ |
| OLD | NEW |