OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 COMPONENTS_EXO_SHELL_SURFACE_H_ |
| 6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/strings/string16.h" |
| 13 #include "components/exo/surface_delegate.h" |
| 14 #include "ui/views/widget/widget_delegate.h" |
| 15 |
| 16 namespace base { |
| 17 namespace trace_event { |
| 18 class TracedValue; |
| 19 } |
| 20 } |
| 21 |
| 22 namespace exo { |
| 23 class Surface; |
| 24 |
| 25 // This class provides functions for treating a surfaces like toplevel, |
| 26 // fullscreen or popup widgets, move, resize or maximize them, associate |
| 27 // metadata like title and class, etc. |
| 28 class ShellSurface : public SurfaceDelegate, public views::WidgetDelegate { |
| 29 public: |
| 30 explicit ShellSurface(Surface* surface); |
| 31 ~ShellSurface() override; |
| 32 |
| 33 // Show surface at the time of the next commit. |
| 34 void Show(); |
| 35 |
| 36 // Show surface as a toplevel window with decorations. |
| 37 void SetToplevel(); |
| 38 |
| 39 // Make the surface fullscreen. |
| 40 void SetFullscreen(bool fullscreen); |
| 41 |
| 42 // Set title for surface. |
| 43 void SetTitle(const base::string16& title); |
| 44 |
| 45 // Returns a trace value representing the state of the surface. |
| 46 scoped_refptr<base::trace_event::TracedValue> AsTracedValue() const; |
| 47 |
| 48 // Overridden from SurfaceDelegate: |
| 49 void OnSurfaceDestroying() override; |
| 50 void OnSurfaceCommit() override; |
| 51 |
| 52 // Overridden from views::WidgetDelegate: |
| 53 base::string16 GetWindowTitle() const override; |
| 54 views::Widget* GetWidget() override; |
| 55 const views::Widget* GetWidget() const override; |
| 56 views::View* GetContentsView() override; |
| 57 views::NonClientFrameView* CreateNonClientFrameView( |
| 58 views::Widget* widget) override; |
| 59 |
| 60 private: |
| 61 scoped_ptr<views::Widget> widget_; |
| 62 Surface* surface_; |
| 63 ui::WindowShowState show_state_; |
| 64 base::string16 title_; |
| 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 67 }; |
| 68 |
| 69 } // namespace exo |
| 70 |
| 71 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
OLD | NEW |