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 ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 5 #ifndef ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| 6 #define ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 6 #define ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/public/interfaces/window_style.mojom.h" | |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/optional.h" | |
| 12 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
| 13 #include "ui/views/window/non_client_view.h" | 15 #include "ui/views/window/non_client_view.h" |
| 14 | 16 |
| 15 namespace views { | 17 namespace views { |
| 16 class Widget; | 18 class Widget; |
| 17 } | 19 } |
| 18 | 20 |
| 19 namespace ash { | 21 namespace ash { |
| 20 | 22 |
| 21 class FrameCaptionButtonContainerView; | 23 class FrameCaptionButtonContainerView; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 36 | 38 |
| 37 // |enable_immersive| controls whether ImmersiveFullscreenController is | 39 // |enable_immersive| controls whether ImmersiveFullscreenController is |
| 38 // created for the CustomFrameViewAsh; if true and a WindowStateDelegate has | 40 // created for the CustomFrameViewAsh; if true and a WindowStateDelegate has |
| 39 // not been set on the WindowState associated with |frame|, then an | 41 // not been set on the WindowState associated with |frame|, then an |
| 40 // ImmersiveFullscreenController is created. | 42 // ImmersiveFullscreenController is created. |
| 41 // If ImmersiveFullscreenControllerDelegate is not supplied, HeaderView is | 43 // If ImmersiveFullscreenControllerDelegate is not supplied, HeaderView is |
| 42 // used as the ImmersiveFullscreenControllerDelegate. | 44 // used as the ImmersiveFullscreenControllerDelegate. |
| 43 explicit CustomFrameViewAsh( | 45 explicit CustomFrameViewAsh( |
| 44 views::Widget* frame, | 46 views::Widget* frame, |
| 45 ImmersiveFullscreenControllerDelegate* immersive_delegate = nullptr, | 47 ImmersiveFullscreenControllerDelegate* immersive_delegate = nullptr, |
| 46 bool enable_immersive = true); | 48 bool enable_immersive = true, |
| 49 mojom::WindowStyle window_style = mojom::WindowStyle::DEFAULT); | |
| 47 ~CustomFrameViewAsh() override; | 50 ~CustomFrameViewAsh() override; |
| 48 | 51 |
| 49 // Inits |immersive_fullscreen_controller| so that the controller reveals | 52 // Inits |immersive_fullscreen_controller| so that the controller reveals |
| 50 // and hides |header_view_| in immersive fullscreen. | 53 // and hides |header_view_| in immersive fullscreen. |
| 51 // CustomFrameViewAsh does not take ownership of | 54 // CustomFrameViewAsh does not take ownership of |
| 52 // |immersive_fullscreen_controller|. | 55 // |immersive_fullscreen_controller|. |
| 53 void InitImmersiveFullscreenControllerForView( | 56 void InitImmersiveFullscreenControllerForView( |
| 54 ImmersiveFullscreenController* immersive_fullscreen_controller); | 57 ImmersiveFullscreenController* immersive_fullscreen_controller); |
| 55 | 58 |
| 56 // Sets the active and inactive frame colors. Note the inactive frame color | 59 // Sets the active and inactive frame colors. Note the inactive frame color |
| 57 // will have some transparency added when the frame is drawn. | 60 // will have some transparency added when the frame is drawn. |
| 58 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); | 61 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); |
| 59 | 62 |
| 63 // Sets the height of the header. If |height| has no value (the default), the | |
| 64 // preferred height is used. | |
| 65 void SetHeaderHeight(base::Optional<int> height); | |
|
James Cook
2017/03/02 21:00:00
This is a little confusing to me. It seems like th
sky
2017/03/02 21:28:42
If you go with the int, you have no way to unset.
James Cook
2017/03/02 21:44:24
Yes, but I don't see you calling SetHeaderHeight()
| |
| 66 | |
| 60 // views::NonClientFrameView: | 67 // views::NonClientFrameView: |
| 61 gfx::Rect GetBoundsForClientView() const override; | 68 gfx::Rect GetBoundsForClientView() const override; |
| 62 gfx::Rect GetWindowBoundsForClientBounds( | 69 gfx::Rect GetWindowBoundsForClientBounds( |
| 63 const gfx::Rect& client_bounds) const override; | 70 const gfx::Rect& client_bounds) const override; |
| 64 int NonClientHitTest(const gfx::Point& point) override; | 71 int NonClientHitTest(const gfx::Point& point) override; |
| 65 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; | 72 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 66 void ResetWindowControls() override; | 73 void ResetWindowControls() override; |
| 67 void UpdateWindowIcon() override; | 74 void UpdateWindowIcon() override; |
| 68 void UpdateWindowTitle() override; | 75 void UpdateWindowTitle() override; |
| 69 void SizeConstraintsChanged() override; | 76 void SizeConstraintsChanged() override; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 97 | 104 |
| 98 // Height from top of window to top of client area. | 105 // Height from top of window to top of client area. |
| 99 int NonClientTopBorderHeight() const; | 106 int NonClientTopBorderHeight() const; |
| 100 | 107 |
| 101 // Not owned. | 108 // Not owned. |
| 102 views::Widget* frame_; | 109 views::Widget* frame_; |
| 103 | 110 |
| 104 // View which contains the title and window controls. | 111 // View which contains the title and window controls. |
| 105 HeaderView* header_view_; | 112 HeaderView* header_view_; |
| 106 | 113 |
| 114 OverlayView* overlay_view_; | |
| 115 | |
| 107 ImmersiveFullscreenControllerDelegate* immersive_delegate_; | 116 ImmersiveFullscreenControllerDelegate* immersive_delegate_; |
| 108 | 117 |
| 109 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); | 118 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); |
| 110 }; | 119 }; |
| 111 | 120 |
| 112 } // namespace ash | 121 } // namespace ash |
| 113 | 122 |
| 114 #endif // ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ | 123 #endif // ASH_COMMON_FRAME_CUSTOM_FRAME_VIEW_ASH_H_ |
| OLD | NEW |