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_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ | 5 #ifndef COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ |
6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ | 6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "components/view_manager/public/cpp/types.h" | 12 #include "components/view_manager/public/cpp/types.h" |
13 #include "components/view_manager/public/interfaces/surface_id.mojom.h" | 13 #include "components/view_manager/public/interfaces/surface_id.mojom.h" |
14 #include "components/view_manager/public/interfaces/view_manager_constants.mojom
.h" | 14 #include "components/view_manager/public/interfaces/view_manager_constants.mojom
.h" |
15 #include "components/view_manager/public/interfaces/view_tree.mojom.h" | 15 #include "components/view_manager/public/interfaces/view_tree.mojom.h" |
16 #include "mojo/application/public/interfaces/service_provider.mojom.h" | 16 #include "mojo/application/public/interfaces/service_provider.mojom.h" |
17 #include "third_party/mojo/src/mojo/public/cpp/bindings/array.h" | 17 #include "third_party/mojo/src/mojo/public/cpp/bindings/array.h" |
18 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" | 18 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" |
19 #include "ui/mojo/geometry/geometry.mojom.h" | 19 #include "ui/mojo/geometry/geometry.mojom.h" |
20 | 20 |
| 21 namespace uip { |
| 22 class Surface; |
| 23 } |
| 24 |
21 namespace mojo { | 25 namespace mojo { |
22 | 26 |
23 class ServiceProviderImpl; | 27 class ServiceProviderImpl; |
24 class View; | 28 class View; |
25 class ViewObserver; | 29 class ViewObserver; |
26 class ViewTreeConnection; | 30 class ViewTreeConnection; |
27 | 31 |
28 // Defined in view_property.h (which we do not include) | 32 // Defined in view_property.h (which we do not include) |
29 template <typename T> | 33 template <typename T> |
30 struct ViewProperty; | 34 struct ViewProperty; |
(...skipping 23 matching lines...) Expand all Loading... |
54 // Geometric disposition. | 58 // Geometric disposition. |
55 const Rect& bounds() const { return bounds_; } | 59 const Rect& bounds() const { return bounds_; } |
56 void SetBounds(const Rect& bounds); | 60 void SetBounds(const Rect& bounds); |
57 | 61 |
58 // Visibility (also see IsDrawn()). When created views are hidden. | 62 // Visibility (also see IsDrawn()). When created views are hidden. |
59 bool visible() const { return visible_; } | 63 bool visible() const { return visible_; } |
60 void SetVisible(bool value); | 64 void SetVisible(bool value); |
61 | 65 |
62 const ViewportMetrics& viewport_metrics() { return *viewport_metrics_; } | 66 const ViewportMetrics& viewport_metrics() { return *viewport_metrics_; } |
63 | 67 |
| 68 scoped_ptr<uip::Surface> RequestSurface(); |
| 69 |
64 // Returns the set of string to bag of byte properties. These properties are | 70 // Returns the set of string to bag of byte properties. These properties are |
65 // shared with the view manager. | 71 // shared with the view manager. |
66 const SharedProperties& shared_properties() const { return properties_; } | 72 const SharedProperties& shared_properties() const { return properties_; } |
67 // Sets a property. If |data| is null, this property is deleted. | 73 // Sets a property. If |data| is null, this property is deleted. |
68 void SetSharedProperty(const std::string& name, | 74 void SetSharedProperty(const std::string& name, |
69 const std::vector<uint8_t>* data); | 75 const std::vector<uint8_t>* data); |
70 | 76 |
71 // Sets the |value| of the given window |property|. Setting to the default | 77 // Sets the |value| of the given window |property|. Setting to the default |
72 // value (e.g., NULL) removes the property. The caller is responsible for the | 78 // value (e.g., NULL) removes the property. The caller is responsible for the |
73 // lifetime of any object set as a property on the View. | 79 // lifetime of any object set as a property on the View. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void RemoveChild(View* child); | 122 void RemoveChild(View* child); |
117 | 123 |
118 void Reorder(View* relative, OrderDirection direction); | 124 void Reorder(View* relative, OrderDirection direction); |
119 void MoveToFront(); | 125 void MoveToFront(); |
120 void MoveToBack(); | 126 void MoveToBack(); |
121 | 127 |
122 bool Contains(View* child) const; | 128 bool Contains(View* child) const; |
123 | 129 |
124 View* GetChildById(Id id); | 130 View* GetChildById(Id id); |
125 | 131 |
126 void SetSurfaceId(SurfaceIdPtr id); | |
127 | |
128 void SetTextInputState(TextInputStatePtr state); | 132 void SetTextInputState(TextInputStatePtr state); |
129 void SetImeVisibility(bool visible, TextInputStatePtr state); | 133 void SetImeVisibility(bool visible, TextInputStatePtr state); |
130 | 134 |
131 // Focus. | 135 // Focus. |
132 void SetFocus(); | 136 void SetFocus(); |
133 bool HasFocus() const; | 137 bool HasFocus() const; |
134 | 138 |
135 // Embedding. See view_tree.mojom for details. | 139 // Embedding. See view_tree.mojom for details. |
136 void Embed(ViewTreeClientPtr client); | 140 void Embed(ViewTreeClientPtr client); |
137 void EmbedAllowingReembed(mojo::URLRequestPtr request); | 141 void EmbedAllowingReembed(mojo::URLRequestPtr request); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 }; | 215 }; |
212 | 216 |
213 std::map<const void*, Value> prop_map_; | 217 std::map<const void*, Value> prop_map_; |
214 | 218 |
215 MOJO_DISALLOW_COPY_AND_ASSIGN(View); | 219 MOJO_DISALLOW_COPY_AND_ASSIGN(View); |
216 }; | 220 }; |
217 | 221 |
218 } // namespace mojo | 222 } // namespace mojo |
219 | 223 |
220 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ | 224 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_H_ |
OLD | NEW |