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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« 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