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