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 "ash/shell_observer.h" | 8 #include "ash/shell_observer.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 class BrowserNonClientFrameViewAsh : public BrowserNonClientFrameView, | 29 class BrowserNonClientFrameViewAsh : public BrowserNonClientFrameView, |
30 public ash::ShellObserver, | 30 public ash::ShellObserver, |
31 public chrome::TabIconViewModel, | 31 public chrome::TabIconViewModel, |
32 public CommandObserver, | 32 public CommandObserver, |
33 public views::ButtonListener { | 33 public views::ButtonListener { |
34 public: | 34 public: |
35 static const char kViewClassName[]; | 35 static const char kViewClassName[]; |
36 | 36 |
37 BrowserNonClientFrameViewAsh(BrowserFrame* frame, BrowserView* browser_view); | 37 BrowserNonClientFrameViewAsh(BrowserFrame* frame, BrowserView* browser_view); |
38 virtual ~BrowserNonClientFrameViewAsh(); | 38 ~BrowserNonClientFrameViewAsh() override; |
39 | 39 |
40 void Init(); | 40 void Init(); |
41 | 41 |
42 // BrowserNonClientFrameView: | 42 // BrowserNonClientFrameView: |
43 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; | 43 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; |
44 virtual int GetTopInset() const override; | 44 int GetTopInset() const override; |
45 virtual int GetThemeBackgroundXInset() const override; | 45 int GetThemeBackgroundXInset() const override; |
46 virtual void UpdateThrobber(bool running) override; | 46 void UpdateThrobber(bool running) override; |
47 | 47 |
48 // views::NonClientFrameView: | 48 // views::NonClientFrameView: |
49 virtual gfx::Rect GetBoundsForClientView() const override; | 49 gfx::Rect GetBoundsForClientView() const override; |
50 virtual gfx::Rect GetWindowBoundsForClientBounds( | 50 gfx::Rect GetWindowBoundsForClientBounds( |
51 const gfx::Rect& client_bounds) const override; | 51 const gfx::Rect& client_bounds) const override; |
52 virtual int NonClientHitTest(const gfx::Point& point) override; | 52 int NonClientHitTest(const gfx::Point& point) override; |
53 virtual void GetWindowMask(const gfx::Size& size, | 53 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
54 gfx::Path* window_mask) override; | 54 void ResetWindowControls() override; |
55 virtual void ResetWindowControls() override; | 55 void UpdateWindowIcon() override; |
56 virtual void UpdateWindowIcon() override; | 56 void UpdateWindowTitle() override; |
57 virtual void UpdateWindowTitle() override; | 57 void SizeConstraintsChanged() override; |
58 virtual void SizeConstraintsChanged() override; | |
59 | 58 |
60 // views::View: | 59 // views::View: |
61 virtual void OnPaint(gfx::Canvas* canvas) override; | 60 void OnPaint(gfx::Canvas* canvas) override; |
62 virtual void Layout() override; | 61 void Layout() override; |
63 virtual const char* GetClassName() const override; | 62 const char* GetClassName() const override; |
64 virtual void GetAccessibleState(ui::AXViewState* state) override; | 63 void GetAccessibleState(ui::AXViewState* state) override; |
65 virtual gfx::Size GetMinimumSize() const override; | 64 gfx::Size GetMinimumSize() const override; |
66 virtual void ChildPreferredSizeChanged(views::View* child) override; | 65 void ChildPreferredSizeChanged(views::View* child) override; |
67 | 66 |
68 // ash::ShellObserver: | 67 // ash::ShellObserver: |
69 virtual void OnMaximizeModeStarted() override; | 68 void OnMaximizeModeStarted() override; |
70 virtual void OnMaximizeModeEnded() override; | 69 void OnMaximizeModeEnded() override; |
71 | 70 |
72 // chrome::TabIconViewModel: | 71 // chrome::TabIconViewModel: |
73 virtual bool ShouldTabIconViewAnimate() const override; | 72 bool ShouldTabIconViewAnimate() const override; |
74 virtual gfx::ImageSkia GetFaviconForTabIconView() override; | 73 gfx::ImageSkia GetFaviconForTabIconView() override; |
75 | 74 |
76 // CommandObserver: | 75 // CommandObserver: |
77 virtual void EnabledStateChangedForCommand(int id, bool enabled) override; | 76 void EnabledStateChangedForCommand(int id, bool enabled) override; |
78 | 77 |
79 // views::ButtonListener: | 78 // views::ButtonListener: |
80 virtual void ButtonPressed(views::Button* sender, | 79 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
81 const ui::Event& event) override; | |
82 | 80 |
83 private: | 81 private: |
84 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); | 82 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); |
85 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 83 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
86 NonImmersiveFullscreen); | 84 NonImmersiveFullscreen); |
87 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 85 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
88 ImmersiveFullscreen); | 86 ImmersiveFullscreen); |
89 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 87 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
90 ToggleMaximizeModeRelayout); | 88 ToggleMaximizeModeRelayout); |
91 | 89 |
92 // views::NonClientFrameView: | 90 // views::NonClientFrameView: |
93 virtual bool DoesIntersectRect(const views::View* target, | 91 bool DoesIntersectRect(const views::View* target, |
94 const gfx::Rect& rect) const override; | 92 const gfx::Rect& rect) const override; |
95 | 93 |
96 // Distance between the left edge of the NonClientFrameView and the tab strip. | 94 // Distance between the left edge of the NonClientFrameView and the tab strip. |
97 int GetTabStripLeftInset() const; | 95 int GetTabStripLeftInset() const; |
98 | 96 |
99 // Distance between the right edge of the NonClientFrameView and the tab | 97 // Distance between the right edge of the NonClientFrameView and the tab |
100 // strip. | 98 // strip. |
101 int GetTabStripRightInset() const; | 99 int GetTabStripRightInset() const; |
102 | 100 |
103 // Returns true if we should use a super short header with light bars instead | 101 // Returns true if we should use a super short header with light bars instead |
104 // of regular tabs. This header is used in immersive fullscreen when the | 102 // of regular tabs. This header is used in immersive fullscreen when the |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 scoped_ptr<ash::HeaderPainter> header_painter_; | 147 scoped_ptr<ash::HeaderPainter> header_painter_; |
150 | 148 |
151 // Updates the hittest bounds overrides based on the window show type. | 149 // Updates the hittest bounds overrides based on the window show type. |
152 scoped_ptr<ash::FrameBorderHitTestController> | 150 scoped_ptr<ash::FrameBorderHitTestController> |
153 frame_border_hit_test_controller_; | 151 frame_border_hit_test_controller_; |
154 | 152 |
155 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); | 153 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); |
156 }; | 154 }; |
157 | 155 |
158 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ | 156 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ |
OLD | NEW |