| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MUS_WS_SERVER_VIEW_H_ | 5 #ifndef COMPONENTS_MUS_WS_SERVER_VIEW_H_ |
| 6 #define COMPONENTS_MUS_WS_SERVER_VIEW_H_ | 6 #define COMPONENTS_MUS_WS_SERVER_VIEW_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "components/mus/public/interfaces/compositor_frame.mojom.h" | 12 #include "components/mus/public/interfaces/compositor_frame.mojom.h" |
| 13 #include "components/mus/public/interfaces/view_tree.mojom.h" | 13 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 14 #include "components/mus/ws/ids.h" | 14 #include "components/mus/ws/ids.h" |
| 15 #include "components/mus/ws/server_view_surface.h" | 15 #include "components/mus/ws/server_view_surface.h" |
| 16 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | 16 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" |
| 17 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 18 #include "ui/gfx/transform.h" | 18 #include "ui/gfx/transform.h" |
| 19 #include "ui/platform_window/text_input_state.h" | 19 #include "ui/platform_window/text_input_state.h" |
| 20 | 20 |
| 21 namespace mus { | 21 namespace mus { |
| 22 | 22 |
| 23 class ServerViewDelegate; | 23 class ServerViewDelegate; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 36 class ServerView { | 36 class ServerView { |
| 37 public: | 37 public: |
| 38 ServerView(ServerViewDelegate* delegate, const ViewId& id); | 38 ServerView(ServerViewDelegate* delegate, const ViewId& id); |
| 39 ~ServerView(); | 39 ~ServerView(); |
| 40 | 40 |
| 41 void AddObserver(ServerViewObserver* observer); | 41 void AddObserver(ServerViewObserver* observer); |
| 42 void RemoveObserver(ServerViewObserver* observer); | 42 void RemoveObserver(ServerViewObserver* observer); |
| 43 | 43 |
| 44 // Binds the provided |request| to |this| object. If an interface is already | 44 // Binds the provided |request| to |this| object. If an interface is already |
| 45 // bound to this ServerView then the old connection is closed first. | 45 // bound to this ServerView then the old connection is closed first. |
| 46 void Bind(mojo::InterfaceRequest<mojo::Surface> request, | 46 void Bind(mojo::InterfaceRequest<mojom::Surface> request, |
| 47 mojo::SurfaceClientPtr client); | 47 mojom::SurfaceClientPtr client); |
| 48 | 48 |
| 49 const ViewId& id() const { return id_; } | 49 const ViewId& id() const { return id_; } |
| 50 | 50 |
| 51 void Add(ServerView* child); | 51 void Add(ServerView* child); |
| 52 void Remove(ServerView* child); | 52 void Remove(ServerView* child); |
| 53 void Reorder(ServerView* child, | 53 void Reorder(ServerView* child, |
| 54 ServerView* relative, | 54 ServerView* relative, |
| 55 mojo::OrderDirection direction); | 55 mojom::OrderDirection direction); |
| 56 | 56 |
| 57 const gfx::Rect& bounds() const { return bounds_; } | 57 const gfx::Rect& bounds() const { return bounds_; } |
| 58 // Sets the bounds. If the size changes this implicitly resets the client | 58 // Sets the bounds. If the size changes this implicitly resets the client |
| 59 // area to fill the whole bounds. | 59 // area to fill the whole bounds. |
| 60 void SetBounds(const gfx::Rect& bounds); | 60 void SetBounds(const gfx::Rect& bounds); |
| 61 | 61 |
| 62 const gfx::Rect& client_area() const { return client_area_; } | 62 const gfx::Rect& client_area() const { return client_area_; } |
| 63 void SetClientArea(const gfx::Rect& bounds); | 63 void SetClientArea(const gfx::Rect& bounds); |
| 64 | 64 |
| 65 const ServerView* parent() const { return parent_; } | 65 const ServerView* parent() const { return parent_; } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 std::map<std::string, std::vector<uint8_t>> properties_; | 139 std::map<std::string, std::vector<uint8_t>> properties_; |
| 140 | 140 |
| 141 base::ObserverList<ServerViewObserver> observers_; | 141 base::ObserverList<ServerViewObserver> observers_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(ServerView); | 143 DISALLOW_COPY_AND_ASSIGN(ServerView); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 } // namespace mus | 146 } // namespace mus |
| 147 | 147 |
| 148 #endif // COMPONENTS_MUS_WS_SERVER_VIEW_H_ | 148 #endif // COMPONENTS_MUS_WS_SERVER_VIEW_H_ |
| OLD | NEW |