| 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 |
| 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 "mojo/public/cpp/bindings/array.h" | 14 #include "mojo/public/cpp/bindings/array.h" |
| 15 #include "services/shell/public/interfaces/interface_provider.mojom.h" | 15 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
| 16 #include "services/ui/common/types.h" | 16 #include "services/ui/common/types.h" |
| 17 #include "services/ui/public/cpp/surface_id_handler.h" |
| 17 #include "services/ui/public/interfaces/mus_constants.mojom.h" | 18 #include "services/ui/public/interfaces/mus_constants.mojom.h" |
| 18 #include "services/ui/public/interfaces/window_tree.mojom.h" | 19 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 19 #include "ui/gfx/geometry/insets.h" | 20 #include "ui/gfx/geometry/insets.h" |
| 20 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
| 21 | 22 |
| 22 namespace gfx { | 23 namespace gfx { |
| 23 class Size; | 24 class Size; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace ui { | 27 namespace ui { |
| 27 | 28 |
| 28 class InputEventHandler; | 29 class InputEventHandler; |
| 29 class ServiceProviderImpl; | 30 class ServiceProviderImpl; |
| 31 class SurfaceIdHandler; |
| 30 class WindowObserver; | 32 class WindowObserver; |
| 31 class WindowSurface; | 33 class WindowSurface; |
| 32 class WindowSurfaceBinding; | 34 class WindowSurfaceBinding; |
| 33 class WindowDropTarget; | 35 class WindowDropTarget; |
| 34 class WindowTreeClient; | 36 class WindowTreeClient; |
| 35 class WindowTreeClientPrivate; | 37 class WindowTreeClientPrivate; |
| 36 | 38 |
| 37 namespace { | 39 namespace { |
| 38 class OrderChangedNotifier; | 40 class OrderChangedNotifier; |
| 39 } | 41 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // | 157 // |
| 156 // These properties are only visible in the current process and are not | 158 // These properties are only visible in the current process and are not |
| 157 // shared with other mojo services. | 159 // shared with other mojo services. |
| 158 template <typename T> | 160 template <typename T> |
| 159 void ClearLocalProperty(const WindowProperty<T>* property); | 161 void ClearLocalProperty(const WindowProperty<T>* property); |
| 160 | 162 |
| 161 void set_input_event_handler(InputEventHandler* input_event_handler) { | 163 void set_input_event_handler(InputEventHandler* input_event_handler) { |
| 162 input_event_handler_ = input_event_handler; | 164 input_event_handler_ = input_event_handler; |
| 163 } | 165 } |
| 164 | 166 |
| 167 void set_surface_id_handler(SurfaceIdHandler* surface_id_handler) { |
| 168 surface_id_handler_ = surface_id_handler; |
| 169 } |
| 170 |
| 165 // Observation. | 171 // Observation. |
| 166 void AddObserver(WindowObserver* observer); | 172 void AddObserver(WindowObserver* observer); |
| 167 void RemoveObserver(WindowObserver* observer); | 173 void RemoveObserver(WindowObserver* observer); |
| 168 | 174 |
| 169 // Tree. | 175 // Tree. |
| 170 Window* parent() { return parent_; } | 176 Window* parent() { return parent_; } |
| 171 const Window* parent() const { return parent_; } | 177 const Window* parent() const { return parent_; } |
| 172 | 178 |
| 173 Window* GetRoot() { | 179 Window* GetRoot() { |
| 174 return const_cast<Window*>(const_cast<const Window*>(this)->GetRoot()); | 180 return const_cast<Window*>(const_cast<const Window*>(this)->GetRoot()); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 void LocalSetClientArea( | 308 void LocalSetClientArea( |
| 303 const gfx::Insets& new_client_area, | 309 const gfx::Insets& new_client_area, |
| 304 const std::vector<gfx::Rect>& additional_client_areas); | 310 const std::vector<gfx::Rect>& additional_client_areas); |
| 305 void LocalSetParentDrawn(bool drawn); | 311 void LocalSetParentDrawn(bool drawn); |
| 306 void LocalSetDisplay(int64_t display_id); | 312 void LocalSetDisplay(int64_t display_id); |
| 307 void LocalSetVisible(bool visible); | 313 void LocalSetVisible(bool visible); |
| 308 void LocalSetOpacity(float opacity); | 314 void LocalSetOpacity(float opacity); |
| 309 void LocalSetPredefinedCursor(mojom::Cursor cursor_id); | 315 void LocalSetPredefinedCursor(mojom::Cursor cursor_id); |
| 310 void LocalSetSharedProperty(const std::string& name, | 316 void LocalSetSharedProperty(const std::string& name, |
| 311 const std::vector<uint8_t>* data); | 317 const std::vector<uint8_t>* data); |
| 318 void LocalSetSurfaceId(std::unique_ptr<SurfaceInfo> surface_info); |
| 312 | 319 |
| 313 // Notifies this winodw that its stacking position has changed. | 320 // Notifies this winodw that its stacking position has changed. |
| 314 void NotifyWindowStackingChanged(); | 321 void NotifyWindowStackingChanged(); |
| 315 // Methods implementing visibility change notifications. See WindowObserver | 322 // Methods implementing visibility change notifications. See WindowObserver |
| 316 // for more details. | 323 // for more details. |
| 317 void NotifyWindowVisibilityChanged(Window* target, bool visible); | 324 void NotifyWindowVisibilityChanged(Window* target, bool visible); |
| 318 // Notifies this window's observers. Returns false if |this| was deleted | 325 // Notifies this window's observers. Returns false if |this| was deleted |
| 319 // during the call (by an observer), otherwise true. | 326 // during the call (by an observer), otherwise true. |
| 320 bool NotifyWindowVisibilityChangedAtReceiver(Window* target, bool visible); | 327 bool NotifyWindowVisibilityChangedAtReceiver(Window* target, bool visible); |
| 321 // Notifies this window and its child hierarchy. Returns false if |this| was | 328 // Notifies this window and its child hierarchy. Returns false if |this| was |
| (...skipping 27 matching lines...) Expand all Loading... |
| 349 Children children_; | 356 Children children_; |
| 350 | 357 |
| 351 Window* stacking_target_; | 358 Window* stacking_target_; |
| 352 Window* transient_parent_; | 359 Window* transient_parent_; |
| 353 Children transient_children_; | 360 Children transient_children_; |
| 354 | 361 |
| 355 bool is_modal_; | 362 bool is_modal_; |
| 356 | 363 |
| 357 base::ObserverList<WindowObserver> observers_; | 364 base::ObserverList<WindowObserver> observers_; |
| 358 InputEventHandler* input_event_handler_; | 365 InputEventHandler* input_event_handler_; |
| 366 SurfaceIdHandler* surface_id_handler_; |
| 359 | 367 |
| 360 gfx::Rect bounds_; | 368 gfx::Rect bounds_; |
| 361 gfx::Insets client_area_; | 369 gfx::Insets client_area_; |
| 362 std::vector<gfx::Rect> additional_client_areas_; | 370 std::vector<gfx::Rect> additional_client_areas_; |
| 363 std::unique_ptr<gfx::Rect> hit_test_mask_; | 371 std::unique_ptr<gfx::Rect> hit_test_mask_; |
| 364 | 372 |
| 365 bool visible_; | 373 bool visible_; |
| 366 float opacity_; | 374 float opacity_; |
| 367 int64_t display_id_; | 375 int64_t display_id_; |
| 368 | 376 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 386 // Key cannot be used for this purpose because it can be char* or | 394 // Key cannot be used for this purpose because it can be char* or |
| 387 // WindowProperty<>. | 395 // WindowProperty<>. |
| 388 struct Value { | 396 struct Value { |
| 389 const char* name; | 397 const char* name; |
| 390 int64_t value; | 398 int64_t value; |
| 391 PropertyDeallocator deallocator; | 399 PropertyDeallocator deallocator; |
| 392 }; | 400 }; |
| 393 | 401 |
| 394 std::map<const void*, Value> prop_map_; | 402 std::map<const void*, Value> prop_map_; |
| 395 | 403 |
| 404 std::unique_ptr<SurfaceInfo> surface_info_; |
| 405 |
| 396 DISALLOW_COPY_AND_ASSIGN(Window); | 406 DISALLOW_COPY_AND_ASSIGN(Window); |
| 397 }; | 407 }; |
| 398 | 408 |
| 399 } // namespace ui | 409 } // namespace ui |
| 400 | 410 |
| 401 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ | 411 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ |
| OLD | NEW |