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_VIEW_TREE_IMPL_H_ | 5 #ifndef COMPONENTS_MUS_VIEW_TREE_IMPL_H_ |
6 #define COMPONENTS_MUS_VIEW_TREE_IMPL_H_ | 6 #define COMPONENTS_MUS_VIEW_TREE_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 bool originated_change); | 107 bool originated_change); |
108 void ProcessViewReorder(const ServerView* view, | 108 void ProcessViewReorder(const ServerView* view, |
109 const ServerView* relative_view, | 109 const ServerView* relative_view, |
110 mojo::OrderDirection direction, | 110 mojo::OrderDirection direction, |
111 bool originated_change); | 111 bool originated_change); |
112 void ProcessViewDeleted(const ViewId& view, bool originated_change); | 112 void ProcessViewDeleted(const ViewId& view, bool originated_change); |
113 void ProcessWillChangeViewVisibility(const ServerView* view, | 113 void ProcessWillChangeViewVisibility(const ServerView* view, |
114 bool originated_change); | 114 bool originated_change); |
115 void ProcessFocusChanged(const ServerView* old_focused_view, | 115 void ProcessFocusChanged(const ServerView* old_focused_view, |
116 const ServerView* new_focused_view); | 116 const ServerView* new_focused_view); |
| 117 void ProcessLostCapture(const ServerView* old_captured_view); |
117 | 118 |
118 private: | 119 private: |
119 using ViewIdSet = base::hash_set<Id>; | 120 using ViewIdSet = base::hash_set<Id>; |
120 using ViewMap = std::map<ConnectionSpecificId, ServerView*>; | 121 using ViewMap = std::map<ConnectionSpecificId, ServerView*>; |
121 | 122 |
122 bool IsViewKnown(const ServerView* view) const; | 123 bool IsViewKnown(const ServerView* view) const; |
123 | 124 |
124 // These functions return true if the corresponding mojom function is allowed | 125 // These functions return true if the corresponding mojom function is allowed |
125 // for this connection. | 126 // for this connection. |
126 bool CanReorderView(const ServerView* view, | 127 bool CanReorderView(const ServerView* view, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 void RemoveViewFromParent( | 181 void RemoveViewFromParent( |
181 Id view_id, | 182 Id view_id, |
182 const mojo::Callback<void(bool)>& callback) override; | 183 const mojo::Callback<void(bool)>& callback) override; |
183 void ReorderView(Id view_id, | 184 void ReorderView(Id view_id, |
184 Id relative_view_id, | 185 Id relative_view_id, |
185 mojo::OrderDirection direction, | 186 mojo::OrderDirection direction, |
186 const mojo::Callback<void(bool)>& callback) override; | 187 const mojo::Callback<void(bool)>& callback) override; |
187 void GetViewTree(Id view_id, | 188 void GetViewTree(Id view_id, |
188 const mojo::Callback<void(mojo::Array<mojo::ViewDataPtr>)>& | 189 const mojo::Callback<void(mojo::Array<mojo::ViewDataPtr>)>& |
189 callback) override; | 190 callback) override; |
| 191 void SetCapture(Id view_id, |
| 192 const mojo::Callback<void(bool)>& callback) override; |
190 void SetViewBounds(Id view_id, | 193 void SetViewBounds(Id view_id, |
191 mojo::RectPtr bounds, | 194 mojo::RectPtr bounds, |
192 const mojo::Callback<void(bool)>& callback) override; | 195 const mojo::Callback<void(bool)>& callback) override; |
193 void SetViewVisibility(Id view_id, | 196 void SetViewVisibility(Id view_id, |
194 bool visible, | 197 bool visible, |
195 const mojo::Callback<void(bool)>& callback) override; | 198 const mojo::Callback<void(bool)>& callback) override; |
196 void SetViewProperty(Id view_id, | 199 void SetViewProperty(Id view_id, |
197 const mojo::String& name, | 200 const mojo::String& name, |
198 mojo::Array<uint8_t> value, | 201 mojo::Array<uint8_t> value, |
199 const mojo::Callback<void(bool)>& callback) override; | 202 const mojo::Callback<void(bool)>& callback) override; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 scoped_ptr<ViewId> root_; | 246 scoped_ptr<ViewId> root_; |
244 | 247 |
245 bool is_embed_root_; | 248 bool is_embed_root_; |
246 | 249 |
247 DISALLOW_COPY_AND_ASSIGN(ViewTreeImpl); | 250 DISALLOW_COPY_AND_ASSIGN(ViewTreeImpl); |
248 }; | 251 }; |
249 | 252 |
250 } // namespace mus | 253 } // namespace mus |
251 | 254 |
252 #endif // COMPONENTS_MUS_VIEW_TREE_IMPL_H_ | 255 #endif // COMPONENTS_MUS_VIEW_TREE_IMPL_H_ |
OLD | NEW |