| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_EXO_SHELL_SURFACE_H_ | 5 #ifndef COMPONENTS_EXO_SHELL_SURFACE_H_ |
| 6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ | 6 #define COMPONENTS_EXO_SHELL_SURFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace exo { | 23 namespace exo { |
| 24 class Surface; | 24 class Surface; |
| 25 | 25 |
| 26 // This class provides functions for treating a surfaces like toplevel, | 26 // This class provides functions for treating a surfaces like toplevel, |
| 27 // fullscreen or popup widgets, move, resize or maximize them, associate | 27 // fullscreen or popup widgets, move, resize or maximize them, associate |
| 28 // metadata like title and class, etc. | 28 // metadata like title and class, etc. |
| 29 class ShellSurface : public SurfaceDelegate, | 29 class ShellSurface : public SurfaceDelegate, |
| 30 public SurfaceObserver, | 30 public SurfaceObserver, |
| 31 public views::WidgetDelegate { | 31 public views::WidgetDelegate, |
| 32 public views::View { |
| 32 public: | 33 public: |
| 33 explicit ShellSurface(Surface* surface); | 34 explicit ShellSurface(Surface* surface); |
| 34 ~ShellSurface() override; | 35 ~ShellSurface() override; |
| 35 | 36 |
| 36 // Show surface as a toplevel window. | 37 // Show surface as a toplevel window. |
| 37 void SetToplevel(); | 38 void SetToplevel(); |
| 38 | 39 |
| 39 // Maximize or show surface as a maximized window. | 40 // Maximize or show surface as a maximized window. |
| 40 void SetMaximized(); | 41 void SetMaximized(); |
| 41 | 42 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 59 void OnSurfaceDestroying(Surface* surface) override; | 60 void OnSurfaceDestroying(Surface* surface) override; |
| 60 | 61 |
| 61 // Overridden from views::WidgetDelegate: | 62 // Overridden from views::WidgetDelegate: |
| 62 base::string16 GetWindowTitle() const override; | 63 base::string16 GetWindowTitle() const override; |
| 63 views::Widget* GetWidget() override; | 64 views::Widget* GetWidget() override; |
| 64 const views::Widget* GetWidget() const override; | 65 const views::Widget* GetWidget() const override; |
| 65 views::View* GetContentsView() override; | 66 views::View* GetContentsView() override; |
| 66 views::NonClientFrameView* CreateNonClientFrameView( | 67 views::NonClientFrameView* CreateNonClientFrameView( |
| 67 views::Widget* widget) override; | 68 views::Widget* widget) override; |
| 68 | 69 |
| 70 // Overridden from views::View: |
| 71 gfx::Size GetPreferredSize() const override; |
| 72 |
| 69 private: | 73 private: |
| 70 scoped_ptr<views::Widget> widget_; | 74 scoped_ptr<views::Widget> widget_; |
| 71 Surface* surface_; | 75 Surface* surface_; |
| 72 base::string16 title_; | 76 base::string16 title_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 78 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 } // namespace exo | 81 } // namespace exo |
| 78 | 82 |
| 79 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 83 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
| OLD | NEW |