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

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: Add ShellSurface::SetTitle 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
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 "components/exo/surface_delegate.h"
13 #include "ui/views/widget/widget_delegate.h"
14
15 namespace base {
16 namespace trace_event {
17 class TracedValue;
18 }
19 }
20
21 namespace exo {
22 class Surface;
23
24 // This class provides functions for treating a surfaces like toplevel,
25 // fullscreen or popup widgets, move, resize or maximize them, associate
26 // metadata like title and class, etc.
27 class ShellSurface : public SurfaceDelegate, public views::WidgetDelegate {
28 public:
29 explicit ShellSurface(Surface* surface);
30 ~ShellSurface() override;
31
32 // Make the surface fullscreen.
33 void SetFullscreen(bool fullscreen);
34
35 // Set title for surface.
36 void SetTitle(const std::string& title);
37
38 // Returns a trace value representing the state of the surface.
39 scoped_refptr<base::trace_event::TracedValue> AsTracedValue() const;
40
41 // Overridden from SurfaceDelegate:
42 void OnSurfaceDestroying() override;
43 void OnSurfaceCommit() override;
44
45 // Overridden from views::WidgetDelegate:
46 std::string GetWindowName() const override;
47 views::Widget* GetWidget() override;
48 const views::Widget* GetWidget() const override;
49 views::View* GetContentsView() override;
50
51 private:
52 scoped_ptr<views::Widget> widget_;
53 Surface* surface_;
54 ui::WindowShowState show_state_;
55 std::string title_;
56
57 DISALLOW_COPY_AND_ASSIGN(ShellSurface);
58 };
59
60 } // namespace exo
61
62 #endif // COMPONENTS_EXO_SHELL_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698