Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Rect; | 18 class Rect; |
| 19 class Vector2d; | |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace ui { | 22 namespace ui { |
| 22 namespace mojom { | 23 namespace mojom { |
| 23 enum class OrderDirection; | 24 enum class OrderDirection; |
| 24 } | 25 } |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace aura { | 28 namespace aura { |
| 28 | 29 |
| 29 struct SurfaceInfo; | 30 struct SurfaceInfo; |
| 30 class Window; | 31 class Window; |
| 31 class WindowTreeClient; | 32 class WindowTreeClient; |
| 32 | 33 |
| 34 // See PrepareForServerBoundsChange() for details on this. | |
| 35 struct AURA_EXPORT WindowMusChangeData { | |
| 36 virtual ~WindowMusChangeData() {} | |
| 37 }; | |
| 38 | |
| 33 // WindowMus defines the interface used by WindowTreeClient to modify | 39 // WindowMus defines the interface used by WindowTreeClient to modify |
| 34 // the underlying Window. It's defined as a separate interface to make it clear | 40 // the underlying Window. It's defined as a separate interface to make it clear |
| 35 // that any changes that WindowTreeClient makes must be propagated through | 41 // that any changes that WindowTreeClient makes must be propagated through |
| 36 // this interface so that they don't result in bouncing back to | 42 // this interface so that they don't result in bouncing back to |
| 37 // WindowTreeClient. For example, if the server change the bounds care must be | 43 // WindowTreeClient. For example, if the server change the bounds care must be |
| 38 // taken that when the change is applied to the Window the server isn't asked to | 44 // taken that when the change is applied to the Window the server isn't asked to |
| 39 // change the bounds too. See WindowPortMus for details. | 45 // change the bounds too. See WindowPortMus for details. |
| 40 class AURA_EXPORT WindowMus { | 46 class AURA_EXPORT WindowMus { |
| 41 public: | 47 public: |
| 42 virtual ~WindowMus() {} | 48 virtual ~WindowMus() {} |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 65 ui::mojom::OrderDirection) = 0; | 71 ui::mojom::OrderDirection) = 0; |
| 66 virtual void SetBoundsFromServer(const gfx::Rect& bounds) = 0; | 72 virtual void SetBoundsFromServer(const gfx::Rect& bounds) = 0; |
| 67 virtual void SetVisibleFromServer(bool visible) = 0; | 73 virtual void SetVisibleFromServer(bool visible) = 0; |
| 68 virtual void SetOpacityFromServer(float opacity) = 0; | 74 virtual void SetOpacityFromServer(float opacity) = 0; |
| 69 virtual void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) = 0; | 75 virtual void SetPredefinedCursorFromServer(ui::mojom::Cursor cursor) = 0; |
| 70 virtual void SetPropertyFromServer(const std::string& property_name, | 76 virtual void SetPropertyFromServer(const std::string& property_name, |
| 71 const std::vector<uint8_t>* data) = 0; | 77 const std::vector<uint8_t>* data) = 0; |
| 72 virtual void SetSurfaceIdFromServer( | 78 virtual void SetSurfaceIdFromServer( |
| 73 std::unique_ptr<SurfaceInfo> surface_info) = 0; | 79 std::unique_ptr<SurfaceInfo> surface_info) = 0; |
| 74 | 80 |
| 81 // Called in the rare case when WindowTreeClient needs to state and can't go | |
|
sadrul
2016/10/27 20:26:17
"...needs to +change state"?
sky
2016/10/27 22:15:04
Done.
| |
| 82 // through one of the SetFooFromServer() functions above. Generally because | |
| 83 // it needs to call another function that as a side effect changes the window. | |
| 84 // Once the call to the underlying window has completed the returned object | |
| 85 // should be destroyed. | |
| 86 virtual std::unique_ptr<WindowMusChangeData> PrepareForServerBoundsChange( | |
| 87 const gfx::Rect& bounds) = 0; | |
| 88 virtual std::unique_ptr<WindowMusChangeData> PrepareForServerVisibilityChange( | |
|
sadrul
2016/10/27 20:26:17
It doesn't look like the visibility one is being u
sky
2016/10/27 22:15:04
It should have. I added test coverage, which uncov
| |
| 89 bool value) = 0; | |
| 90 | |
| 75 virtual void NotifyEmbeddedAppDisconnected() = 0; | 91 virtual void NotifyEmbeddedAppDisconnected() = 0; |
| 76 | 92 |
| 77 private: | 93 private: |
| 78 // Just for set_server_id(), which other places should not call. | 94 // Just for set_server_id(), which other places should not call. |
| 79 friend class WindowTreeClient; | 95 friend class WindowTreeClient; |
| 80 | 96 |
| 81 void set_server_id(Id id) { server_id_ = id; } | 97 void set_server_id(Id id) { server_id_ = id; } |
| 82 | 98 |
| 83 Id server_id_ = kInvalidServerId; | 99 Id server_id_ = kInvalidServerId; |
| 84 }; | 100 }; |
| 85 | 101 |
| 86 } // namespace aura | 102 } // namespace aura |
| 87 | 103 |
| 88 #endif // UI_AURA_MUS_WINDOW_MUS_H_ | 104 #endif // UI_AURA_MUS_WINDOW_MUS_H_ |
| OLD | NEW |