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 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "components/mus/common/types.h" | 14 #include "components/mus/common/types.h" |
| 15 #include "components/mus/public/cpp/mus_public_export.h" |
15 #include "components/mus/public/interfaces/mus_constants.mojom.h" | 16 #include "components/mus/public/interfaces/mus_constants.mojom.h" |
16 #include "components/mus/public/interfaces/surface_id.mojom.h" | 17 #include "components/mus/public/interfaces/surface_id.mojom.h" |
17 #include "components/mus/public/interfaces/window_tree.mojom.h" | 18 #include "components/mus/public/interfaces/window_tree.mojom.h" |
18 #include "mojo/public/cpp/bindings/array.h" | 19 #include "mojo/public/cpp/bindings/array.h" |
19 #include "services/shell/public/interfaces/interface_provider.mojom.h" | 20 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
20 #include "ui/gfx/geometry/insets.h" | 21 #include "ui/gfx/geometry/insets.h" |
21 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
22 | 23 |
23 namespace gfx { | 24 namespace gfx { |
24 class Size; | 25 class Size; |
(...skipping 17 matching lines...) Expand all Loading... |
42 // Defined in window_property.h (which we do not include) | 43 // Defined in window_property.h (which we do not include) |
43 template <typename T> | 44 template <typename T> |
44 struct WindowProperty; | 45 struct WindowProperty; |
45 | 46 |
46 // Windows are owned by the WindowTreeConnection. See WindowTreeDelegate for | 47 // Windows are owned by the WindowTreeConnection. See WindowTreeDelegate for |
47 // details on ownership. | 48 // details on ownership. |
48 // | 49 // |
49 // TODO(beng): Right now, you'll have to implement a WindowObserver to track | 50 // TODO(beng): Right now, you'll have to implement a WindowObserver to track |
50 // destruction and NULL any pointers you have. | 51 // destruction and NULL any pointers you have. |
51 // Investigate some kind of smart pointer or weak pointer for these. | 52 // Investigate some kind of smart pointer or weak pointer for these. |
52 class Window { | 53 class MUS_PUBLIC_EXPORT Window { |
53 public: | 54 public: |
54 using Children = std::vector<Window*>; | 55 using Children = std::vector<Window*>; |
55 using EmbedCallback = base::Callback<void(bool)>; | 56 using EmbedCallback = base::Callback<void(bool)>; |
56 using PropertyDeallocator = void (*)(int64_t value); | 57 using PropertyDeallocator = void (*)(int64_t value); |
57 using SharedProperties = std::map<std::string, std::vector<uint8_t>>; | 58 using SharedProperties = std::map<std::string, std::vector<uint8_t>>; |
58 | 59 |
59 // Destroys this window and all its children. Destruction is allowed for | 60 // Destroys this window and all its children. Destruction is allowed for |
60 // windows that were created by this connection, or the roots. For windows | 61 // windows that were created by this connection, or the roots. For windows |
61 // from other connections (except the roots), Destroy() does nothing. If the | 62 // from other connections (except the roots), Destroy() does nothing. If the |
62 // destruction is allowed observers are notified and the Window is | 63 // destruction is allowed observers are notified and the Window is |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 }; | 355 }; |
355 | 356 |
356 std::map<const void*, Value> prop_map_; | 357 std::map<const void*, Value> prop_map_; |
357 | 358 |
358 DISALLOW_COPY_AND_ASSIGN(Window); | 359 DISALLOW_COPY_AND_ASSIGN(Window); |
359 }; | 360 }; |
360 | 361 |
361 } // namespace mus | 362 } // namespace mus |
362 | 363 |
363 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ | 364 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ |
OLD | NEW |