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_DETATCHED_TITLE_AREA_RENDERER_H_ | |
James Cook
2016/08/24 17:00:32
DETATCHED -> DETACHED
sky
2016/08/24 19:23:29
Done.
| |
6 #define ASH_MUS_FRAME_DETATCHED_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|. | |
James Cook
2016/08/24 17:00:32
nit: reflow
sky
2016/08/24 19:23:29
I thought it was separate to warrant it's own para
| |
41 // This object is deleted either when |window| is destroyed, or Destroy() | |
42 // is called. | |
43 DetachedTitleAreaRenderer(DetachedTitleAreaRendererHost* host, | |
44 views::Widget* frame, | |
45 ui::Window* window, | |
46 Source source); | |
47 | |
48 void Destroy(); | |
49 | |
50 views::Widget* widget() { return widget_; } | |
51 | |
52 // views::WidgetDelegate: | |
53 views::Widget* GetWidget() override; | |
54 const views::Widget* GetWidget() const override; | |
55 void DeleteDelegate() override; | |
56 | |
57 private: | |
58 ~DetachedTitleAreaRenderer() override; | |
59 | |
60 DetachedTitleAreaRendererHost* host_; | |
61 views::Widget* frame_; | |
62 views::Widget* widget_; | |
63 | |
64 DISALLOW_COPY_AND_ASSIGN(DetachedTitleAreaRenderer); | |
65 }; | |
66 | |
67 } // namespace mus | |
68 } // namespace ash | |
69 | |
70 #endif // ASH_MUS_FRAME_DETATCHED_TITLE_AREA_RENDERER_H_ | |
OLD | NEW |