| 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 28 matching lines...) Expand all Loading... |
| 39 void set_close_callback(const base::Closure& close_callback) { | 39 void set_close_callback(const base::Closure& close_callback) { |
| 40 close_callback_ = close_callback; | 40 close_callback_ = close_callback; |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Set the callback to run when the surface is destroyed. | 43 // Set the callback to run when the surface is destroyed. |
| 44 void set_surface_destroyed_callback( | 44 void set_surface_destroyed_callback( |
| 45 const base::Closure& surface_destroyed_callback) { | 45 const base::Closure& surface_destroyed_callback) { |
| 46 surface_destroyed_callback_ = surface_destroyed_callback; | 46 surface_destroyed_callback_ = surface_destroyed_callback; |
| 47 } | 47 } |
| 48 | 48 |
| 49 // Show surface as a toplevel window. | 49 // Set the callback to run when the client is asked to resize the surface. |
| 50 void SetToplevel(); | 50 // The size is a hint, in the sense that the client is free to ignore it if |
| 51 // it doesn't resize, pick a smaller size (to satisfy aspect ratio or resize |
| 52 // in steps of NxM pixels). |
| 53 using ConfigureCallback = base::Callback<void(const gfx::Size& size)>; |
| 54 void set_configure_callback(const ConfigureCallback& configure_callback) { |
| 55 configure_callback_ = configure_callback; |
| 56 } |
| 51 | 57 |
| 52 // Maximize or show surface as a maximized window. | 58 // Initialize shell surface as a toplevel window. |
| 53 void SetMaximized(); | 59 void Init(); |
| 54 | 60 |
| 55 // Fullscreen or show surface as a fullscreen window. | 61 // Maximizes the shell surface. |
| 56 void SetFullscreen(); | 62 void Maximize(); |
| 63 |
| 64 // Set fullscreen state for shell surface. |
| 65 void SetFullscreen(bool fullscreen); |
| 57 | 66 |
| 58 // Set title for surface. | 67 // Set title for surface. |
| 59 void SetTitle(const base::string16& title); | 68 void SetTitle(const base::string16& title); |
| 60 | 69 |
| 61 // Sets the application ID for the window. The application ID identifies the | 70 // Sets the application ID for the window. The application ID identifies the |
| 62 // general class of applications to which the window belongs. | 71 // general class of applications to which the window belongs. |
| 63 static void SetApplicationId(aura::Window* window, | 72 static void SetApplicationId(aura::Window* window, |
| 64 std::string* application_id); | 73 std::string* application_id); |
| 65 static const std::string GetApplicationId(aura::Window* window); | 74 static const std::string GetApplicationId(aura::Window* window); |
| 66 | 75 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 gfx::Size GetPreferredSize() const override; | 109 gfx::Size GetPreferredSize() const override; |
| 101 | 110 |
| 102 private: | 111 private: |
| 103 scoped_ptr<views::Widget> widget_; | 112 scoped_ptr<views::Widget> widget_; |
| 104 Surface* surface_; | 113 Surface* surface_; |
| 105 base::string16 title_; | 114 base::string16 title_; |
| 106 std::string application_id_; | 115 std::string application_id_; |
| 107 gfx::Rect geometry_; | 116 gfx::Rect geometry_; |
| 108 base::Closure close_callback_; | 117 base::Closure close_callback_; |
| 109 base::Closure surface_destroyed_callback_; | 118 base::Closure surface_destroyed_callback_; |
| 119 ConfigureCallback configure_callback_; |
| 110 | 120 |
| 111 DISALLOW_COPY_AND_ASSIGN(ShellSurface); | 121 DISALLOW_COPY_AND_ASSIGN(ShellSurface); |
| 112 }; | 122 }; |
| 113 | 123 |
| 114 } // namespace exo | 124 } // namespace exo |
| 115 | 125 |
| 116 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ | 126 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ |
| OLD | NEW |