Index: components/exo/shell_surface.h |
diff --git a/components/exo/shell_surface.h b/components/exo/shell_surface.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e997d019f03f59ba98227ce23e3fd2e9771ef17a |
--- /dev/null |
+++ b/components/exo/shell_surface.h |
@@ -0,0 +1,71 @@ |
+// Copyright 2015 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 COMPONENTS_EXO_SHELL_SURFACE_H_ |
+#define COMPONENTS_EXO_SHELL_SURFACE_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/strings/string16.h" |
+#include "components/exo/surface_delegate.h" |
+#include "ui/views/widget/widget_delegate.h" |
+ |
+namespace base { |
+namespace trace_event { |
+class TracedValue; |
+} |
+} |
+ |
+namespace exo { |
+class Surface; |
+ |
+// This class provides functions for treating a surfaces like toplevel, |
+// fullscreen or popup widgets, move, resize or maximize them, associate |
+// metadata like title and class, etc. |
+class ShellSurface : public SurfaceDelegate, public views::WidgetDelegate { |
+ public: |
+ explicit ShellSurface(Surface* surface); |
+ ~ShellSurface() override; |
+ |
+ // Show surface at the time of the next commit. |
+ void Show(); |
+ |
+ // Show surface as a toplevel window with decorations. |
+ void SetToplevel(); |
+ |
+ // Make the surface fullscreen. |
+ void SetFullscreen(bool fullscreen); |
+ |
+ // Set title for surface. |
+ void SetTitle(const base::string16& title); |
+ |
+ // Returns a trace value representing the state of the surface. |
+ scoped_refptr<base::trace_event::TracedValue> AsTracedValue() const; |
+ |
+ // Overridden from SurfaceDelegate: |
+ void OnSurfaceDestroying() override; |
+ void OnSurfaceCommit() override; |
+ |
+ // Overridden from views::WidgetDelegate: |
+ base::string16 GetWindowTitle() const override; |
+ views::Widget* GetWidget() override; |
+ const views::Widget* GetWidget() const override; |
+ views::View* GetContentsView() override; |
+ views::NonClientFrameView* CreateNonClientFrameView( |
+ views::Widget* widget) override; |
+ |
+ private: |
+ scoped_ptr<views::Widget> widget_; |
+ Surface* surface_; |
+ ui::WindowShowState show_state_; |
+ base::string16 title_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
+}; |
+ |
+} // namespace exo |
+ |
+#endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |