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 SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 bool HasCapture() const; | 203 bool HasCapture() const; |
204 void SetCapture(); | 204 void SetCapture(); |
205 void ReleaseCapture(); | 205 void ReleaseCapture(); |
206 | 206 |
207 // Focus. See WindowTreeClient::ClearFocus() to reset focus. | 207 // Focus. See WindowTreeClient::ClearFocus() to reset focus. |
208 void SetFocus(); | 208 void SetFocus(); |
209 bool HasFocus() const; | 209 bool HasFocus() const; |
210 void SetCanFocus(bool can_focus); | 210 void SetCanFocus(bool can_focus); |
211 | 211 |
| 212 // Sets whether this window accepts events. |
| 213 void SetCanAcceptEvents(bool can_accept_events); |
| 214 |
212 // Embedding. See window_tree.mojom for details. | 215 // Embedding. See window_tree.mojom for details. |
213 void Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags = 0); | 216 void Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags = 0); |
214 | 217 |
215 // NOTE: callback is run synchronously if Embed() is not allowed on this | 218 // NOTE: callback is run synchronously if Embed() is not allowed on this |
216 // Window. | 219 // Window. |
217 void Embed(ui::mojom::WindowTreeClientPtr client, | 220 void Embed(ui::mojom::WindowTreeClientPtr client, |
218 const EmbedCallback& callback, | 221 const EmbedCallback& callback, |
219 uint32_t flags = 0); | 222 uint32_t flags = 0); |
220 | 223 |
221 // TODO(sky): this API is only applicable to the WindowManager. Move it | 224 // TODO(sky): this API is only applicable to the WindowManager. Move it |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 335 |
333 gfx::Rect bounds_; | 336 gfx::Rect bounds_; |
334 gfx::Insets client_area_; | 337 gfx::Insets client_area_; |
335 std::vector<gfx::Rect> additional_client_areas_; | 338 std::vector<gfx::Rect> additional_client_areas_; |
336 std::unique_ptr<gfx::Rect> hit_test_mask_; | 339 std::unique_ptr<gfx::Rect> hit_test_mask_; |
337 | 340 |
338 bool visible_; | 341 bool visible_; |
339 float opacity_; | 342 float opacity_; |
340 int64_t display_id_; | 343 int64_t display_id_; |
341 | 344 |
| 345 // Whether this window can accept events. Initialized to true to |
| 346 // match ServerWindow. |
| 347 bool can_accept_events_ = true; |
| 348 |
342 mojom::Cursor cursor_id_; | 349 mojom::Cursor cursor_id_; |
343 | 350 |
344 SharedProperties properties_; | 351 SharedProperties properties_; |
345 | 352 |
346 // Drawn state of our parent. This is only meaningful for root Windows, in | 353 // Drawn state of our parent. This is only meaningful for root Windows, in |
347 // which the parent Window isn't exposed to the client. | 354 // which the parent Window isn't exposed to the client. |
348 bool parent_drawn_; | 355 bool parent_drawn_; |
349 | 356 |
350 // Value struct to keep the name and deallocator for this property. | 357 // Value struct to keep the name and deallocator for this property. |
351 // Key cannot be used for this purpose because it can be char* or | 358 // Key cannot be used for this purpose because it can be char* or |
352 // WindowProperty<>. | 359 // WindowProperty<>. |
353 struct Value { | 360 struct Value { |
354 const char* name; | 361 const char* name; |
355 int64_t value; | 362 int64_t value; |
356 PropertyDeallocator deallocator; | 363 PropertyDeallocator deallocator; |
357 }; | 364 }; |
358 | 365 |
359 std::map<const void*, Value> prop_map_; | 366 std::map<const void*, Value> prop_map_; |
360 | 367 |
361 DISALLOW_COPY_AND_ASSIGN(Window); | 368 DISALLOW_COPY_AND_ASSIGN(Window); |
362 }; | 369 }; |
363 | 370 |
364 } // namespace ui | 371 } // namespace ui |
365 | 372 |
366 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 373 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
OLD | NEW |