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

Side by Side Diff: components/exo/shell_surface.h

Issue 1645043003: exo: Improve window placement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Set the callback to run when the client is asked to resize the surface. 49 // Set the callback to run when the client is asked to resize the surface.
50 // The size is a hint, in the sense that the client is free to ignore it if 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 51 // it doesn't resize, pick a smaller size (to satisfy aspect ratio or resize
52 // in steps of NxM pixels). 52 // in steps of NxM pixels).
53 using ConfigureCallback = base::Callback<void(const gfx::Size& size)>; 53 using ConfigureCallback = base::Callback<void(const gfx::Size& size)>;
54 void set_configure_callback(const ConfigureCallback& configure_callback) { 54 void set_configure_callback(const ConfigureCallback& configure_callback) {
55 configure_callback_ = configure_callback; 55 configure_callback_ = configure_callback;
56 } 56 }
57 57
58 // Initialize shell surface as a toplevel window.
59 void Init();
60
61 // Maximizes the shell surface. 58 // Maximizes the shell surface.
62 void Maximize(); 59 void Maximize();
63 60
64 // Set fullscreen state for shell surface. 61 // Set fullscreen state for shell surface.
65 void SetFullscreen(bool fullscreen); 62 void SetFullscreen(bool fullscreen);
66 63
67 // Set title for surface. 64 // Set title for surface.
68 void SetTitle(const base::string16& title); 65 void SetTitle(const base::string16& title);
69 66
70 // Sets the application ID for the window. The application ID identifies the 67 // Sets the application ID for the window. The application ID identifies the
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 views::Widget* GetWidget() override; 99 views::Widget* GetWidget() override;
103 const views::Widget* GetWidget() const override; 100 const views::Widget* GetWidget() const override;
104 views::View* GetContentsView() override; 101 views::View* GetContentsView() override;
105 views::NonClientFrameView* CreateNonClientFrameView( 102 views::NonClientFrameView* CreateNonClientFrameView(
106 views::Widget* widget) override; 103 views::Widget* widget) override;
107 104
108 // Overridden from views::View: 105 // Overridden from views::View:
109 gfx::Size GetPreferredSize() const override; 106 gfx::Size GetPreferredSize() const override;
110 107
111 private: 108 private:
109 // Creates the |widget_| for |surface_|.
110 void CreateShellSurfaceWidget();
111
112 scoped_ptr<views::Widget> widget_; 112 scoped_ptr<views::Widget> widget_;
113 Surface* surface_; 113 Surface* surface_;
114 base::string16 title_; 114 base::string16 title_;
115 std::string application_id_; 115 std::string application_id_;
116 gfx::Rect geometry_; 116 gfx::Rect geometry_;
117 base::Closure close_callback_; 117 base::Closure close_callback_;
118 base::Closure surface_destroyed_callback_; 118 base::Closure surface_destroyed_callback_;
119 ConfigureCallback configure_callback_; 119 ConfigureCallback configure_callback_;
120 120
121 DISALLOW_COPY_AND_ASSIGN(ShellSurface); 121 DISALLOW_COPY_AND_ASSIGN(ShellSurface);
122 }; 122 };
123 123
124 } // namespace exo 124 } // namespace exo
125 125
126 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_ 126 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698