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_ASH_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/shell_observer.h" | 10 #include "ash/common/shell_observer.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 13 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 14 #include "chrome/browser/ui/views/tab_icon_view_model.h" | 14 #include "chrome/browser/ui/views/tab_icon_view_model.h" |
| 15 | 15 |
| 16 class TabIconView; | 16 class TabIconView; |
| 17 class WebAppLeftHeaderView; | |
| 18 | 17 |
| 19 namespace ash { | 18 namespace ash { |
| 20 class FrameCaptionButtonContainerView; | 19 class FrameCaptionButtonContainerView; |
| 21 class HeaderPainter; | 20 class HeaderPainter; |
| 22 } | 21 } |
| 23 | 22 |
| 24 class BrowserNonClientFrameViewAsh : public BrowserNonClientFrameView, | 23 class BrowserNonClientFrameViewAsh : public BrowserNonClientFrameView, |
| 25 public ash::ShellObserver, | 24 public ash::ShellObserver, |
| 26 public TabIconViewModel { | 25 public TabIconViewModel { |
| 27 public: | 26 public: |
| 28 BrowserNonClientFrameViewAsh(BrowserFrame* frame, BrowserView* browser_view); | 27 BrowserNonClientFrameViewAsh(BrowserFrame* frame, BrowserView* browser_view); |
| 29 ~BrowserNonClientFrameViewAsh() override; | 28 ~BrowserNonClientFrameViewAsh() override; |
| 30 | 29 |
| 31 void Init(); | 30 void Init(); |
| 32 | 31 |
| 33 // BrowserNonClientFrameView: | 32 // BrowserNonClientFrameView: |
| 34 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; | 33 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; |
| 35 int GetTopInset(bool restored) const override; | 34 int GetTopInset(bool restored) const override; |
| 36 int GetThemeBackgroundXInset() const override; | 35 int GetThemeBackgroundXInset() const override; |
| 37 void UpdateThrobber(bool running) override; | 36 void UpdateThrobber(bool running) override; |
| 38 void UpdateToolbar() override; | |
|
tapted
2016/12/06 23:52:28
Can this be deleted from BrowserNonClientFrameView
benwells
2016/12/15 23:08:41
Done.
| |
| 39 views::View* GetLocationIconView() const override; | |
|
tapted
2016/12/06 23:52:28
Same here - I think it's just ash/mus that overrid
benwells
2016/12/15 23:08:41
Done.
| |
| 40 | 37 |
| 41 // views::NonClientFrameView: | 38 // views::NonClientFrameView: |
| 42 gfx::Rect GetBoundsForClientView() const override; | 39 gfx::Rect GetBoundsForClientView() const override; |
| 43 gfx::Rect GetWindowBoundsForClientBounds( | 40 gfx::Rect GetWindowBoundsForClientBounds( |
| 44 const gfx::Rect& client_bounds) const override; | 41 const gfx::Rect& client_bounds) const override; |
| 45 int NonClientHitTest(const gfx::Point& point) override; | 42 int NonClientHitTest(const gfx::Point& point) override; |
| 46 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; | 43 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 47 void ResetWindowControls() override; | 44 void ResetWindowControls() override; |
| 48 void UpdateWindowIcon() override; | 45 void UpdateWindowIcon() override; |
| 49 void UpdateWindowTitle() override; | 46 void UpdateWindowTitle() override; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 74 private: | 71 private: |
| 75 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); | 72 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); |
| 76 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 73 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
| 77 NonImmersiveFullscreen); | 74 NonImmersiveFullscreen); |
| 78 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 75 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
| 79 ImmersiveFullscreen); | 76 ImmersiveFullscreen); |
| 80 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 77 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
| 81 ToggleMaximizeModeRelayout); | 78 ToggleMaximizeModeRelayout); |
| 82 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 79 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
| 83 AvatarDisplayOnTeleportedWindow); | 80 AvatarDisplayOnTeleportedWindow); |
| 84 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, BackButton); | |
| 85 FRIEND_TEST_ALL_PREFIXES(WebAppLeftHeaderViewTest, LocationIcon); | |
| 86 friend class BrowserHeaderPainterAsh; | 81 friend class BrowserHeaderPainterAsh; |
| 87 | 82 |
| 88 // Distance between the left edge of the NonClientFrameView and the tab strip. | 83 // Distance between the left edge of the NonClientFrameView and the tab strip. |
| 89 int GetTabStripLeftInset() const; | 84 int GetTabStripLeftInset() const; |
| 90 | 85 |
| 91 // Distance between the right edge of the NonClientFrameView and the tab | 86 // Distance between the right edge of the NonClientFrameView and the tab |
| 92 // strip. | 87 // strip. |
| 93 int GetTabStripRightInset() const; | 88 int GetTabStripRightInset() const; |
| 94 | 89 |
| 95 // Returns true if we should use a super short header with light bars instead | 90 // Returns true if we should use a super short header with light bars instead |
| 96 // of regular tabs. This header is used in immersive fullscreen when the | 91 // of regular tabs. This header is used in immersive fullscreen when the |
| 97 // top-of-window views are not revealed. | 92 // top-of-window views are not revealed. |
| 98 bool UseImmersiveLightbarHeaderStyle() const; | 93 bool UseImmersiveLightbarHeaderStyle() const; |
| 99 | 94 |
| 100 // Returns true if the header should be painted so that it looks the same as | 95 // Returns true if the header should be painted so that it looks the same as |
| 101 // the header used for packaged apps. Packaged apps use a different color | 96 // the header used for packaged apps. Packaged apps use a different color |
| 102 // scheme than browser windows. | 97 // scheme than browser windows. |
| 103 bool UsePackagedAppHeaderStyle() const; | 98 bool UsePackagedAppHeaderStyle() const; |
| 104 | 99 |
| 105 // Returns true if the header should be painted with a WebApp header style. | |
| 106 // The WebApp header style has a back button and title along with the usual | |
| 107 // accoutrements. | |
| 108 bool UseWebAppHeaderStyle() const; | |
| 109 | |
| 110 void LayoutProfileIndicatorIcon(); | 100 void LayoutProfileIndicatorIcon(); |
| 111 | 101 |
| 112 // Returns true if there is anything to paint. Some fullscreen windows do not | 102 // Returns true if there is anything to paint. Some fullscreen windows do not |
| 113 // need their frames painted. | 103 // need their frames painted. |
| 114 bool ShouldPaint() const; | 104 bool ShouldPaint() const; |
| 115 | 105 |
| 116 void PaintToolbarBackground(gfx::Canvas* canvas); | 106 void PaintToolbarBackground(gfx::Canvas* canvas); |
| 117 | 107 |
| 118 // View which contains the window controls. | 108 // View which contains the window controls. |
| 119 ash::FrameCaptionButtonContainerView* caption_button_container_; | 109 ash::FrameCaptionButtonContainerView* caption_button_container_; |
| 120 | 110 |
| 121 // The holder for the buttons on the left side of the header. This is included | |
| 122 // for web app style frames, and includes a back button and location icon. | |
| 123 WebAppLeftHeaderView* web_app_left_header_view_; | |
| 124 | |
| 125 // For popups, the window icon. | 111 // For popups, the window icon. |
| 126 TabIconView* window_icon_; | 112 TabIconView* window_icon_; |
| 127 | 113 |
| 128 // Helper class for painting the header. | 114 // Helper class for painting the header. |
| 129 std::unique_ptr<ash::HeaderPainter> header_painter_; | 115 std::unique_ptr<ash::HeaderPainter> header_painter_; |
| 130 | 116 |
| 131 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); | 117 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); |
| 132 }; | 118 }; |
| 133 | 119 |
| 134 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ | 120 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ |
| OLD | NEW |