| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/views/frame/avatar_button_manager.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 10 | 11 |
| 11 class BrowserNonClientFrameViewMac : public BrowserNonClientFrameView { | 12 class BrowserNonClientFrameViewMac : public BrowserNonClientFrameView { |
| 12 public: | 13 public: |
| 13 // Mac implementation of BrowserNonClientFrameView. | 14 // Mac implementation of BrowserNonClientFrameView. |
| 14 BrowserNonClientFrameViewMac(BrowserFrame* frame, BrowserView* browser_view); | 15 BrowserNonClientFrameViewMac(BrowserFrame* frame, BrowserView* browser_view); |
| 15 ~BrowserNonClientFrameViewMac() override; | 16 ~BrowserNonClientFrameViewMac() override; |
| 16 | 17 |
| 17 // BrowserNonClientFrameView: | 18 // BrowserNonClientFrameView: |
| 19 void OnBrowserViewInitViewsComplete() override; |
| 18 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; | 20 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; |
| 19 int GetTopInset(bool restored) const override; | 21 int GetTopInset(bool restored) const override; |
| 20 int GetThemeBackgroundXInset() const override; | 22 int GetThemeBackgroundXInset() const override; |
| 21 void UpdateThrobber(bool running) override; | 23 void UpdateThrobber(bool running) override; |
| 24 views::View* GetProfileSwitcherView() const override; |
| 22 | 25 |
| 23 // views::NonClientFrameView: | 26 // views::NonClientFrameView: |
| 24 gfx::Rect GetBoundsForClientView() const override; | 27 gfx::Rect GetBoundsForClientView() const override; |
| 25 gfx::Rect GetWindowBoundsForClientBounds( | 28 gfx::Rect GetWindowBoundsForClientBounds( |
| 26 const gfx::Rect& client_bounds) const override; | 29 const gfx::Rect& client_bounds) const override; |
| 27 int NonClientHitTest(const gfx::Point& point) override; | 30 int NonClientHitTest(const gfx::Point& point) override; |
| 28 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; | 31 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 29 void ResetWindowControls() override; | 32 void ResetWindowControls() override; |
| 30 void UpdateWindowIcon() override; | 33 void UpdateWindowIcon() override; |
| 31 void UpdateWindowTitle() override; | 34 void UpdateWindowTitle() override; |
| 32 void SizeConstraintsChanged() override; | 35 void SizeConstraintsChanged() override; |
| 33 | 36 |
| 34 // views::View: | 37 // views::View: |
| 35 gfx::Size GetMinimumSize() const override; | 38 gfx::Size GetMinimumSize() const override; |
| 36 | 39 |
| 37 protected: | 40 protected: |
| 38 // views::View: | 41 // views::View: |
| 39 void OnPaint(gfx::Canvas* canvas) override; | 42 void OnPaint(gfx::Canvas* canvas) override; |
| 43 void Layout() override; |
| 44 |
| 45 // views::ViewTargeterDelegate: |
| 46 bool DoesIntersectRect(const View* target, |
| 47 const gfx::Rect& rect) const override; |
| 40 | 48 |
| 41 // BrowserNonClientFrameView: | 49 // BrowserNonClientFrameView: |
| 42 void UpdateProfileIcons() override; | 50 void UpdateProfileIcons() override; |
| 43 | 51 |
| 44 private: | 52 private: |
| 53 // Distance between the right edge of the frame and the tab strip. |
| 54 int GetTabStripRightInset() const; |
| 55 |
| 45 void PaintThemedFrame(gfx::Canvas* canvas); | 56 void PaintThemedFrame(gfx::Canvas* canvas); |
| 46 void PaintToolbarBackground(gfx::Canvas* canvas); | 57 void PaintToolbarBackground(gfx::Canvas* canvas); |
| 47 | 58 |
| 59 // Wrapper around the in-frame avatar switcher. |
| 60 AvatarButtonManager profile_switcher_; |
| 61 |
| 48 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewMac); | 62 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewMac); |
| 49 }; | 63 }; |
| 50 | 64 |
| 51 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_MAC_H_ | 65 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_MAC_H_ |
| OLD | NEW |