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

Side by Side Diff: ui/aura/mus/window_mus.h

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 UI_AURA_MUS_WINDOW_MUS_H_ 5 #ifndef UI_AURA_MUS_WINDOW_MUS_H_
6 #define UI_AURA_MUS_WINDOW_MUS_H_ 6 #define UI_AURA_MUS_WINDOW_MUS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "services/ui/public/interfaces/cursor.mojom.h" 13 #include "services/ui/public/interfaces/cursor.mojom.h"
14 #include "ui/aura/aura_export.h" 14 #include "ui/aura/aura_export.h"
15 #include "ui/aura/mus/mus_types.h" 15 #include "ui/aura/mus/mus_types.h"
16 #include "ui/compositor/layer_type.h"
16 17
17 namespace cc { 18 namespace cc {
18 class SurfaceInfo; 19 class SurfaceInfo;
19 } 20 }
20 21
21 namespace gfx { 22 namespace gfx {
22 class Rect; 23 class Rect;
23 } 24 }
24 25
25 namespace ui { 26 namespace ui {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 61
61 // Returns the WindowMus associated with |window|. 62 // Returns the WindowMus associated with |window|.
62 static WindowMus* Get(Window* window); 63 static WindowMus* Get(Window* window);
63 64
64 Id server_id() const { return server_id_; } 65 Id server_id() const { return server_id_; }
65 66
66 WindowMusType window_mus_type() const { return window_mus_type_; } 67 WindowMusType window_mus_type() const { return window_mus_type_; }
67 68
68 virtual Window* GetWindow() = 0; 69 virtual Window* GetWindow() = 0;
69 70
71 virtual void SetLayerType(ui::LayerType layer_type) = 0;
72 virtual ui::LayerType GetLayerType() const = 0;
73
70 // These functions are called in response to a change from the server. The 74 // These functions are called in response to a change from the server. The
71 // expectation is that in calling these WindowTreeClient is not called 75 // expectation is that in calling these WindowTreeClient is not called
72 // back. For example, SetBoundsFromServer() should not result in calling back 76 // back. For example, SetBoundsFromServer() should not result in calling back
73 // to WindowTreeClient::OnWindowMusBoundsChanged(). 77 // to WindowTreeClient::OnWindowMusBoundsChanged().
74 virtual void AddChildFromServer(WindowMus* window) = 0; 78 virtual void AddChildFromServer(WindowMus* window) = 0;
75 virtual void RemoveChildFromServer(WindowMus* child) = 0; 79 virtual void RemoveChildFromServer(WindowMus* child) = 0;
76 virtual void ReorderFromServer(WindowMus* child, 80 virtual void ReorderFromServer(WindowMus* child,
77 WindowMus* relative, 81 WindowMus* relative,
78 ui::mojom::OrderDirection) = 0; 82 ui::mojom::OrderDirection) = 0;
79 virtual void SetBoundsFromServer(const gfx::Rect& bounds) = 0; 83 virtual void SetBoundsFromServer(const gfx::Rect& bounds,
84 const cc::LocalFrameId& local_frame_Id) = 0;
80 virtual void SetVisibleFromServer(bool visible) = 0; 85 virtual void SetVisibleFromServer(bool visible) = 0;
81 virtual void SetOpacityFromServer(float opacity) = 0; 86 virtual void SetOpacityFromServer(float opacity) = 0;
82 virtual void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) = 0; 87 virtual void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) = 0;
83 virtual void SetPropertyFromServer(const std::string& property_name, 88 virtual void SetPropertyFromServer(const std::string& property_name,
84 const std::vector<uint8_t>* data) = 0; 89 const std::vector<uint8_t>* data) = 0;
85 virtual void SetSurfaceInfoFromServer( 90 virtual void SetSurfaceInfoFromServer(
86 const cc::SurfaceInfo& surface_info) = 0; 91 const cc::SurfaceInfo& surface_info) = 0;
92 virtual void SetLocalFrameIdFromServer(
93 const cc::LocalFrameId& local_frame_id) = 0;
87 // The window was deleted on the server side. DestroyFromServer() should 94 // The window was deleted on the server side. DestroyFromServer() should
88 // result in deleting |this|. 95 // result in deleting |this|.
89 virtual void DestroyFromServer() = 0; 96 virtual void DestroyFromServer() = 0;
90 virtual void AddTransientChildFromServer(WindowMus* child) = 0; 97 virtual void AddTransientChildFromServer(WindowMus* child) = 0;
91 virtual void RemoveTransientChildFromServer(WindowMus* child) = 0; 98 virtual void RemoveTransientChildFromServer(WindowMus* child) = 0;
92 // Called when a window was added/removed as a transient child. 99 // Called when a window was added/removed as a transient child.
93 virtual ChangeSource OnTransientChildAdded(WindowMus* child) = 0; 100 virtual ChangeSource OnTransientChildAdded(WindowMus* child) = 0;
94 virtual ChangeSource OnTransientChildRemoved(WindowMus* child) = 0; 101 virtual ChangeSource OnTransientChildRemoved(WindowMus* child) = 0;
95 102
96 // Called in the rare case when WindowTreeClient needs to change state and 103 // Called in the rare case when WindowTreeClient needs to change state and
(...skipping 24 matching lines...) Expand all
121 128
122 void set_server_id(Id id) { server_id_ = id; } 129 void set_server_id(Id id) { server_id_ = id; }
123 130
124 Id server_id_ = kInvalidServerId; 131 Id server_id_ = kInvalidServerId;
125 const WindowMusType window_mus_type_; 132 const WindowMusType window_mus_type_;
126 }; 133 };
127 134
128 } // namespace aura 135 } // namespace aura
129 136
130 #endif // UI_AURA_MUS_WINDOW_MUS_H_ 137 #endif // UI_AURA_MUS_WINDOW_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698