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 // Only calls ui::WindowTreeClient's SetCanAcceptEvents if the new | |
msw
2016/07/13 01:04:19
nit: Ah, this was a description of the function's
riajiang
2016/07/13 18:03:49
Removed
| |
214 // setting is different from the current one. | |
215 void SetCanAcceptEvents(bool can_accept_events); | |
216 | |
212 // Embedding. See window_tree.mojom for details. | 217 // Embedding. See window_tree.mojom for details. |
213 void Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags = 0); | 218 void Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags = 0); |
214 | 219 |
215 // NOTE: callback is run synchronously if Embed() is not allowed on this | 220 // NOTE: callback is run synchronously if Embed() is not allowed on this |
216 // Window. | 221 // Window. |
217 void Embed(ui::mojom::WindowTreeClientPtr client, | 222 void Embed(ui::mojom::WindowTreeClientPtr client, |
218 const EmbedCallback& callback, | 223 const EmbedCallback& callback, |
219 uint32_t flags = 0); | 224 uint32_t flags = 0); |
220 | 225 |
221 // TODO(sky): this API is only applicable to the WindowManager. Move it | 226 // 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 | 337 |
333 gfx::Rect bounds_; | 338 gfx::Rect bounds_; |
334 gfx::Insets client_area_; | 339 gfx::Insets client_area_; |
335 std::vector<gfx::Rect> additional_client_areas_; | 340 std::vector<gfx::Rect> additional_client_areas_; |
336 std::unique_ptr<gfx::Rect> hit_test_mask_; | 341 std::unique_ptr<gfx::Rect> hit_test_mask_; |
337 | 342 |
338 bool visible_; | 343 bool visible_; |
339 float opacity_; | 344 float opacity_; |
340 int64_t display_id_; | 345 int64_t display_id_; |
341 | 346 |
347 // Whether this window can accept events. Initialized to true to | |
348 // match ServerWindow. | |
349 bool can_accept_events_ = true; | |
350 | |
342 mojom::Cursor cursor_id_; | 351 mojom::Cursor cursor_id_; |
343 | 352 |
344 SharedProperties properties_; | 353 SharedProperties properties_; |
345 | 354 |
346 // Drawn state of our parent. This is only meaningful for root Windows, in | 355 // Drawn state of our parent. This is only meaningful for root Windows, in |
347 // which the parent Window isn't exposed to the client. | 356 // which the parent Window isn't exposed to the client. |
348 bool parent_drawn_; | 357 bool parent_drawn_; |
349 | 358 |
350 // Value struct to keep the name and deallocator for this property. | 359 // 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 | 360 // Key cannot be used for this purpose because it can be char* or |
352 // WindowProperty<>. | 361 // WindowProperty<>. |
353 struct Value { | 362 struct Value { |
354 const char* name; | 363 const char* name; |
355 int64_t value; | 364 int64_t value; |
356 PropertyDeallocator deallocator; | 365 PropertyDeallocator deallocator; |
357 }; | 366 }; |
358 | 367 |
359 std::map<const void*, Value> prop_map_; | 368 std::map<const void*, Value> prop_map_; |
360 | 369 |
361 DISALLOW_COPY_AND_ASSIGN(Window); | 370 DISALLOW_COPY_AND_ASSIGN(Window); |
362 }; | 371 }; |
363 | 372 |
364 } // namespace ui | 373 } // namespace ui |
365 | 374 |
366 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 375 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
OLD | NEW |