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

Unified Diff: components/exo/shell_surface.h

Issue 1412093006: components: Add Exosphere component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove some ifdefs Created 5 years, 1 month 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 | « components/exo/shared_memory_unittest.cc ('k') | components/exo/shell_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « components/exo/shared_memory_unittest.cc ('k') | components/exo/shell_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698