| 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/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 13 #include "chrome/browser/ui/views/tab_icon_view_model.h" | 13 #include "chrome/browser/ui/views/tab_icon_view_model.h" |
| 14 #include "ui/views/controls/button/button.h" | |
| 15 | 14 |
| 16 class TabIconView; | 15 class TabIconView; |
| 17 class WebAppLeftHeaderView; | 16 class WebAppLeftHeaderView; |
| 18 | 17 |
| 19 namespace ash { | 18 namespace ash { |
| 20 class FrameBorderHitTestController; | 19 class FrameBorderHitTestController; |
| 21 class FrameCaptionButton; | 20 class FrameCaptionButton; |
| 22 class FrameCaptionButtonContainerView; | 21 class FrameCaptionButtonContainerView; |
| 23 class HeaderPainter; | 22 class HeaderPainter; |
| 24 } | 23 } |
| 25 | 24 |
| 26 namespace views { | 25 namespace views { |
| 27 class ImageButton; | 26 class ImageButton; |
| 28 class ToggleImageButton; | 27 class ToggleImageButton; |
| 29 } | 28 } |
| 30 | 29 |
| 31 class BrowserNonClientFrameViewAsh : public BrowserNonClientFrameView, | 30 class BrowserNonClientFrameViewAsh : public BrowserNonClientFrameView, |
| 32 public ash::ShellObserver, | 31 public ash::ShellObserver, |
| 33 public TabIconViewModel, | 32 public TabIconViewModel { |
| 34 public views::ButtonListener { | |
| 35 public: | 33 public: |
| 36 static const char kViewClassName[]; | 34 static const char kViewClassName[]; |
| 37 | 35 |
| 38 BrowserNonClientFrameViewAsh(BrowserFrame* frame, BrowserView* browser_view); | 36 BrowserNonClientFrameViewAsh(BrowserFrame* frame, BrowserView* browser_view); |
| 39 ~BrowserNonClientFrameViewAsh() override; | 37 ~BrowserNonClientFrameViewAsh() override; |
| 40 | 38 |
| 41 void Init(); | 39 void Init(); |
| 42 | 40 |
| 43 // BrowserNonClientFrameView: | 41 // BrowserNonClientFrameView: |
| 44 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; | 42 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 68 void ChildPreferredSizeChanged(views::View* child) override; | 66 void ChildPreferredSizeChanged(views::View* child) override; |
| 69 | 67 |
| 70 // ash::ShellObserver: | 68 // ash::ShellObserver: |
| 71 void OnMaximizeModeStarted() override; | 69 void OnMaximizeModeStarted() override; |
| 72 void OnMaximizeModeEnded() override; | 70 void OnMaximizeModeEnded() override; |
| 73 | 71 |
| 74 // TabIconViewModel: | 72 // TabIconViewModel: |
| 75 bool ShouldTabIconViewAnimate() const override; | 73 bool ShouldTabIconViewAnimate() const override; |
| 76 gfx::ImageSkia GetFaviconForTabIconView() override; | 74 gfx::ImageSkia GetFaviconForTabIconView() override; |
| 77 | 75 |
| 78 // views::ButtonListener: | |
| 79 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
| 80 | |
| 81 protected: | 76 protected: |
| 82 // BrowserNonClientFrameView: | 77 // BrowserNonClientFrameView: |
| 83 void UpdateNewAvatarButtonImpl() override; | 78 void UpdateNewAvatarButtonImpl() override; |
| 84 | 79 |
| 85 private: | 80 private: |
| 86 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); | 81 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, WindowHeader); |
| 87 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 82 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
| 88 NonImmersiveFullscreen); | 83 NonImmersiveFullscreen); |
| 89 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, | 84 FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, |
| 90 ImmersiveFullscreen); | 85 ImmersiveFullscreen); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 114 // scheme than browser windows. | 109 // scheme than browser windows. |
| 115 bool UsePackagedAppHeaderStyle() const; | 110 bool UsePackagedAppHeaderStyle() const; |
| 116 | 111 |
| 117 // Returns true if the header should be painted with a WebApp header style. | 112 // Returns true if the header should be painted with a WebApp header style. |
| 118 // The WebApp header style has a back button and title along with the usual | 113 // The WebApp header style has a back button and title along with the usual |
| 119 // accoutrements. | 114 // accoutrements. |
| 120 bool UseWebAppHeaderStyle() const; | 115 bool UseWebAppHeaderStyle() const; |
| 121 | 116 |
| 122 // Layout the avatar button. | 117 // Layout the avatar button. |
| 123 void LayoutAvatar(); | 118 void LayoutAvatar(); |
| 124 #if defined(FRAME_AVATAR_BUTTON) | |
| 125 void LayoutNewStyleAvatar(); | |
| 126 #endif | |
| 127 | 119 |
| 128 // Returns true if there is anything to paint. Some fullscreen windows do not | 120 // Returns true if there is anything to paint. Some fullscreen windows do not |
| 129 // need their frames painted. | 121 // need their frames painted. |
| 130 bool ShouldPaint() const; | 122 bool ShouldPaint() const; |
| 131 | 123 |
| 132 // Paints the header background when the frame is in immersive fullscreen and | 124 // Paints the header background when the frame is in immersive fullscreen and |
| 133 // tab light bar is visible. | 125 // tab light bar is visible. |
| 134 void PaintImmersiveLightbarStyleHeader(gfx::Canvas* canvas); | 126 void PaintImmersiveLightbarStyleHeader(gfx::Canvas* canvas); |
| 135 | 127 |
| 136 void PaintToolbarBackground(gfx::Canvas* canvas); | 128 void PaintToolbarBackground(gfx::Canvas* canvas); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 153 scoped_ptr<ash::HeaderPainter> header_painter_; | 145 scoped_ptr<ash::HeaderPainter> header_painter_; |
| 154 | 146 |
| 155 // Updates the hittest bounds overrides based on the window show type. | 147 // Updates the hittest bounds overrides based on the window show type. |
| 156 scoped_ptr<ash::FrameBorderHitTestController> | 148 scoped_ptr<ash::FrameBorderHitTestController> |
| 157 frame_border_hit_test_controller_; | 149 frame_border_hit_test_controller_; |
| 158 | 150 |
| 159 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); | 151 DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAsh); |
| 160 }; | 152 }; |
| 161 | 153 |
| 162 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ | 154 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_ASH_H_ |
| OLD | NEW |