OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_MUS_FRAME_DETACHED_TITLE_AREA_RENDERER_H_ |
| 6 #define ASH_MUS_FRAME_DETACHED_TITLE_AREA_RENDERER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "ui/views/widget/widget_delegate.h" |
| 10 |
| 11 namespace ui { |
| 12 class Window; |
| 13 } |
| 14 |
| 15 namespace ash { |
| 16 namespace mus { |
| 17 |
| 18 class DetachedTitleAreaRendererHost; |
| 19 |
| 20 // DetachedTitleAreaRenderer contains a HeaderView in a widget. It's intended to |
| 21 // be used when the title area needs to be rendered in a window different from |
| 22 // the normal window the title area renders to (such as in immersive mode). |
| 23 class DetachedTitleAreaRenderer : public views::WidgetDelegate { |
| 24 public: |
| 25 // Used to indicate why this is being created. |
| 26 enum class Source { |
| 27 // This is being created at the request of a client, specifically because |
| 28 // of kRendererParentTitleArea_Property set on a client owned window. |
| 29 CLIENT, |
| 30 |
| 31 // Mash is creating this class to host an immersive reveal. Note that CLIENT |
| 32 // is also likely used for an immersive reveal, but for CLIENT the client |
| 33 // is completely controlling the reveal and not mash. In other words for |
| 34 // CLIENT ImmersiveFullscreenController is not running in mash. |
| 35 MASH, |
| 36 }; |
| 37 |
| 38 // Creates a widget to render the title area and shows it. |window| is the |
| 39 // window to render to and |widget| the widget whose frame state is rendered |
| 40 // to |window|. This object is deleted either when |window| is destroyed, or |
| 41 // Destroy() is called. |
| 42 DetachedTitleAreaRenderer(DetachedTitleAreaRendererHost* host, |
| 43 views::Widget* frame, |
| 44 ui::Window* window, |
| 45 Source source); |
| 46 |
| 47 void Destroy(); |
| 48 |
| 49 views::Widget* widget() { return widget_; } |
| 50 |
| 51 // views::WidgetDelegate: |
| 52 views::Widget* GetWidget() override; |
| 53 const views::Widget* GetWidget() const override; |
| 54 void DeleteDelegate() override; |
| 55 |
| 56 private: |
| 57 ~DetachedTitleAreaRenderer() override; |
| 58 |
| 59 DetachedTitleAreaRendererHost* host_; |
| 60 views::Widget* frame_; |
| 61 views::Widget* widget_; |
| 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(DetachedTitleAreaRenderer); |
| 64 }; |
| 65 |
| 66 } // namespace mus |
| 67 } // namespace ash |
| 68 |
| 69 #endif // ASH_MUS_FRAME_DETACHED_TITLE_AREA_RENDERER_H_ |
OLD | NEW |