| 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 UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 5 #ifndef UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
| 6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 6 #define UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/atomicops.h" | 16 #include "base/atomicops.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "mojo/public/cpp/bindings/associated_binding.h" | 21 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 22 #include "mojo/public/cpp/bindings/strong_binding.h" | 22 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 23 #include "services/ui/public/interfaces/window_tree.mojom.h" | 23 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 24 #include "ui/aura/aura_export.h" | 24 #include "ui/aura/aura_export.h" |
| 25 #include "ui/aura/client/capture_client_observer.h" | 25 #include "ui/aura/client/capture_client_observer.h" |
| 26 #include "ui/aura/client/focus_change_observer.h" | 26 #include "ui/aura/client/focus_change_observer.h" |
| 27 #include "ui/aura/client/transient_window_client_observer.h" |
| 27 #include "ui/aura/mus/mus_types.h" | 28 #include "ui/aura/mus/mus_types.h" |
| 28 #include "ui/aura/mus/window_manager_delegate.h" | 29 #include "ui/aura/mus/window_manager_delegate.h" |
| 29 #include "ui/aura/mus/window_tree_host_mus_delegate.h" | 30 #include "ui/aura/mus/window_tree_host_mus_delegate.h" |
| 30 | 31 |
| 31 namespace display { | 32 namespace display { |
| 32 class Display; | 33 class Display; |
| 33 } | 34 } |
| 34 | 35 |
| 35 namespace gfx { | 36 namespace gfx { |
| 36 class Insets; | 37 class Insets; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 67 // WindowTreeClient is owned by the creator. Generally when the delegate gets | 68 // WindowTreeClient is owned by the creator. Generally when the delegate gets |
| 68 // one of OnEmbedRootDestroyed() or OnLostConnection() it should delete the | 69 // one of OnEmbedRootDestroyed() or OnLostConnection() it should delete the |
| 69 // WindowTreeClient. | 70 // WindowTreeClient. |
| 70 // | 71 // |
| 71 // When WindowTreeClient is deleted all windows are deleted (and observers | 72 // When WindowTreeClient is deleted all windows are deleted (and observers |
| 72 // notified). | 73 // notified). |
| 73 class AURA_EXPORT WindowTreeClient | 74 class AURA_EXPORT WindowTreeClient |
| 74 : NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient), | 75 : NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient), |
| 75 NON_EXPORTED_BASE(public ui::mojom::WindowManager), | 76 NON_EXPORTED_BASE(public ui::mojom::WindowManager), |
| 76 public WindowManagerClient, | 77 public WindowManagerClient, |
| 78 public WindowTreeHostMusDelegate, |
| 77 public client::CaptureClientObserver, | 79 public client::CaptureClientObserver, |
| 78 public client::FocusChangeObserver, | 80 public client::FocusChangeObserver, |
| 79 public WindowTreeHostMusDelegate { | 81 public client::TransientWindowClientObserver { |
| 80 public: | 82 public: |
| 81 explicit WindowTreeClient( | 83 explicit WindowTreeClient( |
| 82 WindowTreeClientDelegate* delegate, | 84 WindowTreeClientDelegate* delegate, |
| 83 WindowManagerDelegate* window_manager_delegate = nullptr, | 85 WindowManagerDelegate* window_manager_delegate = nullptr, |
| 84 ui::mojom::WindowTreeClientRequest request = nullptr); | 86 ui::mojom::WindowTreeClientRequest request = nullptr); |
| 85 ~WindowTreeClient() override; | 87 ~WindowTreeClient() override; |
| 86 | 88 |
| 87 // Establishes the connection by way of the WindowTreeFactory. | 89 // Establishes the connection by way of the WindowTreeFactory. |
| 88 void ConnectViaWindowTreeFactory(service_manager::Connector* connector); | 90 void ConnectViaWindowTreeFactory(service_manager::Connector* connector); |
| 89 | 91 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 440 |
| 439 // Overriden from client::FocusChangeObserver: | 441 // Overriden from client::FocusChangeObserver: |
| 440 void OnWindowFocused(Window* gained_focus, Window* lost_focus) override; | 442 void OnWindowFocused(Window* gained_focus, Window* lost_focus) override; |
| 441 | 443 |
| 442 // Overriden from client::CaptureClientObserver: | 444 // Overriden from client::CaptureClientObserver: |
| 443 void OnCaptureChanged(Window* lost_capture, Window* gained_capture) override; | 445 void OnCaptureChanged(Window* lost_capture, Window* gained_capture) override; |
| 444 | 446 |
| 445 // Overriden from WindowTreeHostMusDelegate: | 447 // Overriden from WindowTreeHostMusDelegate: |
| 446 void SetRootWindowBounds(Window* window, gfx::Rect* bounds) override; | 448 void SetRootWindowBounds(Window* window, gfx::Rect* bounds) override; |
| 447 | 449 |
| 450 // Override from client::TransientWindowClientObserver: |
| 451 void OnTransientChildWindowAdded(Window* parent, |
| 452 Window* transient_child) override; |
| 453 void OnTransientChildWindowRemoved(Window* parent, |
| 454 Window* transient_child) override; |
| 455 |
| 448 // The one int in |cursor_location_mapping_|. When we read from this | 456 // The one int in |cursor_location_mapping_|. When we read from this |
| 449 // location, we must always read from it atomically. | 457 // location, we must always read from it atomically. |
| 450 base::subtle::Atomic32* cursor_location_memory() { | 458 base::subtle::Atomic32* cursor_location_memory() { |
| 451 return reinterpret_cast<base::subtle::Atomic32*>( | 459 return reinterpret_cast<base::subtle::Atomic32*>( |
| 452 cursor_location_mapping_.get()); | 460 cursor_location_mapping_.get()); |
| 453 } | 461 } |
| 454 | 462 |
| 455 // This is set once and only once when we get OnEmbed(). It gives the unique | 463 // This is set once and only once when we get OnEmbed(). It gives the unique |
| 456 // id for this client. | 464 // id for this client. |
| 457 ClientSpecificId client_id_; | 465 ClientSpecificId client_id_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 std::set<Id> drag_entered_windows_; | 536 std::set<Id> drag_entered_windows_; |
| 529 | 537 |
| 530 base::WeakPtrFactory<WindowTreeClient> weak_factory_; | 538 base::WeakPtrFactory<WindowTreeClient> weak_factory_; |
| 531 | 539 |
| 532 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); | 540 DISALLOW_COPY_AND_ASSIGN(WindowTreeClient); |
| 533 }; | 541 }; |
| 534 | 542 |
| 535 } // namespace aura | 543 } // namespace aura |
| 536 | 544 |
| 537 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ | 545 #endif // UI_AURA_MUS_WINDOW_TREE_CLIENT_H_ |
| OLD | NEW |