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_PUBLIC_CPP_WINDOW_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // Transient tree. | 183 // Transient tree. |
184 Window* transient_parent() { return transient_parent_; } | 184 Window* transient_parent() { return transient_parent_; } |
185 const Window* transient_parent() const { return transient_parent_; } | 185 const Window* transient_parent() const { return transient_parent_; } |
186 const Children& transient_children() const { return transient_children_; } | 186 const Children& transient_children() const { return transient_children_; } |
187 | 187 |
188 Window* GetChildById(Id id); | 188 Window* GetChildById(Id id); |
189 | 189 |
190 void SetTextInputState(mojo::TextInputStatePtr state); | 190 void SetTextInputState(mojo::TextInputStatePtr state); |
191 void SetImeVisibility(bool visible, mojo::TextInputStatePtr state); | 191 void SetImeVisibility(bool visible, mojo::TextInputStatePtr state); |
192 | 192 |
| 193 bool has_capture() const { return has_capture_; } |
| 194 void SetCapture(); |
| 195 void ReleaseCapture(); |
| 196 |
193 // Focus. | 197 // Focus. |
194 void SetFocus(); | 198 void SetFocus(); |
195 bool HasFocus() const; | 199 bool HasFocus() const; |
196 void SetCanFocus(bool can_focus); | 200 void SetCanFocus(bool can_focus); |
197 | 201 |
198 // Embedding. See window_tree.mojom for details. | 202 // Embedding. See window_tree.mojom for details. |
199 void Embed(mus::mojom::WindowTreeClientPtr client); | 203 void Embed(mus::mojom::WindowTreeClientPtr client); |
200 | 204 |
201 // NOTE: callback is run synchronously if Embed() is not allowed on this | 205 // NOTE: callback is run synchronously if Embed() is not allowed on this |
202 // Window. | 206 // Window. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 int64_t default_value) const; | 239 int64_t default_value) const; |
236 | 240 |
237 void LocalDestroy(); | 241 void LocalDestroy(); |
238 void LocalAddChild(Window* child); | 242 void LocalAddChild(Window* child); |
239 void LocalRemoveChild(Window* child); | 243 void LocalRemoveChild(Window* child); |
240 void LocalAddTransientWindow(Window* transient_window); | 244 void LocalAddTransientWindow(Window* transient_window); |
241 void LocalRemoveTransientWindow(Window* transient_window); | 245 void LocalRemoveTransientWindow(Window* transient_window); |
242 // Returns true if the order actually changed. | 246 // Returns true if the order actually changed. |
243 bool LocalReorder(Window* relative, mojom::OrderDirection direction); | 247 bool LocalReorder(Window* relative, mojom::OrderDirection direction); |
244 void LocalSetBounds(const gfx::Rect& old_bounds, const gfx::Rect& new_bounds); | 248 void LocalSetBounds(const gfx::Rect& old_bounds, const gfx::Rect& new_bounds); |
| 249 void LocalSetCapture(bool capture); |
245 void LocalSetClientArea( | 250 void LocalSetClientArea( |
246 const gfx::Insets& new_client_area, | 251 const gfx::Insets& new_client_area, |
247 const std::vector<gfx::Rect>& additional_client_areas); | 252 const std::vector<gfx::Rect>& additional_client_areas); |
248 void LocalSetViewportMetrics(const mojom::ViewportMetrics& old_metrics, | 253 void LocalSetViewportMetrics(const mojom::ViewportMetrics& old_metrics, |
249 const mojom::ViewportMetrics& new_metrics); | 254 const mojom::ViewportMetrics& new_metrics); |
250 void LocalSetDrawn(bool drawn); | 255 void LocalSetDrawn(bool drawn); |
251 void LocalSetVisible(bool visible); | 256 void LocalSetVisible(bool visible); |
252 void LocalSetPredefinedCursor(mojom::Cursor cursor_id); | 257 void LocalSetPredefinedCursor(mojom::Cursor cursor_id); |
253 void LocalSetSharedProperty(const std::string& name, | 258 void LocalSetSharedProperty(const std::string& name, |
254 const std::vector<uint8_t>* data); | 259 const std::vector<uint8_t>* data); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 base::ObserverList<WindowObserver> observers_; | 301 base::ObserverList<WindowObserver> observers_; |
297 InputEventHandler* input_event_handler_; | 302 InputEventHandler* input_event_handler_; |
298 | 303 |
299 gfx::Rect bounds_; | 304 gfx::Rect bounds_; |
300 gfx::Insets client_area_; | 305 gfx::Insets client_area_; |
301 std::vector<gfx::Rect> additional_client_areas_; | 306 std::vector<gfx::Rect> additional_client_areas_; |
302 | 307 |
303 mojom::ViewportMetricsPtr viewport_metrics_; | 308 mojom::ViewportMetricsPtr viewport_metrics_; |
304 | 309 |
305 bool visible_; | 310 bool visible_; |
| 311 bool has_capture_; |
306 | 312 |
307 mojom::Cursor cursor_id_; | 313 mojom::Cursor cursor_id_; |
308 | 314 |
309 SharedProperties properties_; | 315 SharedProperties properties_; |
310 | 316 |
311 // Drawn state is derived from the visible state and the parent's visible | 317 // Drawn state is derived from the visible state and the parent's visible |
312 // state. This field is only used if the window has no parent (eg it's a | 318 // state. This field is only used if the window has no parent (eg it's a |
313 // root). | 319 // root). |
314 bool drawn_; | 320 bool drawn_; |
315 | 321 |
316 // Value struct to keep the name and deallocator for this property. | 322 // Value struct to keep the name and deallocator for this property. |
317 // Key cannot be used for this purpose because it can be char* or | 323 // Key cannot be used for this purpose because it can be char* or |
318 // WindowProperty<>. | 324 // WindowProperty<>. |
319 struct Value { | 325 struct Value { |
320 const char* name; | 326 const char* name; |
321 int64_t value; | 327 int64_t value; |
322 PropertyDeallocator deallocator; | 328 PropertyDeallocator deallocator; |
323 }; | 329 }; |
324 | 330 |
325 std::map<const void*, Value> prop_map_; | 331 std::map<const void*, Value> prop_map_; |
326 | 332 |
327 MOJO_DISALLOW_COPY_AND_ASSIGN(Window); | 333 MOJO_DISALLOW_COPY_AND_ASSIGN(Window); |
328 }; | 334 }; |
329 | 335 |
330 } // namespace mus | 336 } // namespace mus |
331 | 337 |
332 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ | 338 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ |
OLD | NEW |