Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2423)

Unified Diff: ash/mus/frame/detached_title_area_renderer.h

Issue 2277563002: Wires up immersive mode for chrome and mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/frame/custom_frame_view_mus.cc ('k') | ash/mus/frame/detached_title_area_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/frame/detached_title_area_renderer.h
diff --git a/ash/mus/frame/detached_title_area_renderer.h b/ash/mus/frame/detached_title_area_renderer.h
new file mode 100644
index 0000000000000000000000000000000000000000..45715b07aa7f89952882e360fbf3f4d808c7ae7c
--- /dev/null
+++ b/ash/mus/frame/detached_title_area_renderer.h
@@ -0,0 +1,69 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_MUS_FRAME_DETACHED_TITLE_AREA_RENDERER_H_
+#define ASH_MUS_FRAME_DETACHED_TITLE_AREA_RENDERER_H_
+
+#include "base/macros.h"
+#include "ui/views/widget/widget_delegate.h"
+
+namespace ui {
+class Window;
+}
+
+namespace ash {
+namespace mus {
+
+class DetachedTitleAreaRendererHost;
+
+// DetachedTitleAreaRenderer contains a HeaderView in a widget. It's intended to
+// be used when the title area needs to be rendered in a window different from
+// the normal window the title area renders to (such as in immersive mode).
+class DetachedTitleAreaRenderer : public views::WidgetDelegate {
+ public:
+ // Used to indicate why this is being created.
+ enum class Source {
+ // This is being created at the request of a client, specifically because
+ // of kRendererParentTitleArea_Property set on a client owned window.
+ CLIENT,
+
+ // Mash is creating this class to host an immersive reveal. Note that CLIENT
+ // is also likely used for an immersive reveal, but for CLIENT the client
+ // is completely controlling the reveal and not mash. In other words for
+ // CLIENT ImmersiveFullscreenController is not running in mash.
+ MASH,
+ };
+
+ // Creates a widget to render the title area and shows it. |window| is the
+ // window to render to and |widget| the widget whose frame state is rendered
+ // to |window|. This object is deleted either when |window| is destroyed, or
+ // Destroy() is called.
+ DetachedTitleAreaRenderer(DetachedTitleAreaRendererHost* host,
+ views::Widget* frame,
+ ui::Window* window,
+ Source source);
+
+ void Destroy();
+
+ views::Widget* widget() { return widget_; }
+
+ // views::WidgetDelegate:
+ views::Widget* GetWidget() override;
+ const views::Widget* GetWidget() const override;
+ void DeleteDelegate() override;
+
+ private:
+ ~DetachedTitleAreaRenderer() override;
+
+ DetachedTitleAreaRendererHost* host_;
+ views::Widget* frame_;
+ views::Widget* widget_;
+
+ DISALLOW_COPY_AND_ASSIGN(DetachedTitleAreaRenderer);
+};
+
+} // namespace mus
+} // namespace ash
+
+#endif // ASH_MUS_FRAME_DETACHED_TITLE_AREA_RENDERER_H_
« no previous file with comments | « ash/mus/frame/custom_frame_view_mus.cc ('k') | ash/mus/frame/detached_title_area_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698