Index: ui/aura/mus/window_tree_client.h |
diff --git a/ui/aura/mus/window_tree_client.h b/ui/aura/mus/window_tree_client.h |
index ee9c38153b534707dfe10d9554d051674e6592e1..5ea408053a36004c4c608d1d24dda1d091059d65 100644 |
--- a/ui/aura/mus/window_tree_client.h |
+++ b/ui/aura/mus/window_tree_client.h |
@@ -22,10 +22,10 @@ |
#include "mojo/public/cpp/bindings/strong_binding.h" |
#include "services/ui/public/interfaces/window_tree.mojom.h" |
#include "ui/aura/aura_export.h" |
+#include "ui/aura/client/focus_change_observer.h" |
#include "ui/aura/client/transient_window_client_observer.h" |
#include "ui/aura/mus/capture_synchronizer_delegate.h" |
#include "ui/aura/mus/drag_drop_controller_host.h" |
-#include "ui/aura/mus/focus_synchronizer_delegate.h" |
#include "ui/aura/mus/mus_types.h" |
#include "ui/aura/mus/window_manager_delegate.h" |
#include "ui/aura/mus/window_tree_host_mus_delegate.h" |
@@ -45,7 +45,6 @@ |
namespace aura { |
class CaptureSynchronizer; |
class DragDropControllerMus; |
-class FocusSynchronizer; |
class InFlightBoundsChange; |
class InFlightChange; |
class InFlightFocusChange; |
@@ -79,10 +78,10 @@ |
: NON_EXPORTED_BASE(public ui::mojom::WindowTreeClient), |
NON_EXPORTED_BASE(public ui::mojom::WindowManager), |
public CaptureSynchronizerDelegate, |
- public FocusSynchronizerDelegate, |
public DragDropControllerHost, |
public WindowManagerClient, |
public WindowTreeHostMusDelegate, |
+ public client::FocusChangeObserver, |
public client::TransientWindowClientObserver { |
public: |
explicit WindowTreeClient( |
@@ -137,6 +136,10 @@ |
// Returns the root of this connection. |
std::set<Window*> GetRoots(); |
+ // Returns the focused window; null if focus is not yet known or another app |
+ // is focused. |
+ Window* GetFocusedWindow(); |
+ |
// Returns the current location of the mouse on screen. Note: this method may |
// race the asynchronous initialization; but in that case we return (0, 0). |
gfx::Point GetCursorScreenPoint(); |
@@ -180,6 +183,10 @@ |
// Returns true if the specified window was created by this client. |
bool WasCreatedByThisClient(const WindowMus* window) const; |
+ |
+ void SetFocusFromServer(WindowMus* window); |
+ void SetFocusFromServerImpl(client::FocusClient* focus_client, |
+ WindowMus* window); |
// Returns the oldest InFlightChange that matches |change|. |
InFlightChange* GetOldestInFlightChangeMatching(const InFlightChange& change); |
@@ -411,6 +418,9 @@ |
const gfx::Vector2d& offset, |
const gfx::Insets& hit_area) override; |
+ // Overriden from client::FocusChangeObserver: |
+ void OnWindowFocused(Window* gained_focus, Window* lost_focus) override; |
+ |
// Overriden from WindowTreeHostMusDelegate: |
void OnWindowTreeHostBoundsWillChange(WindowTreeHostMus* window_tree_host, |
const gfx::Rect& bounds) override; |
@@ -428,9 +438,6 @@ |
// Overrided from CaptureSynchronizerDelegate: |
uint32_t CreateChangeIdForCapture(WindowMus* window) override; |
- |
- // Overrided from FocusSynchronizerDelegate: |
- uint32_t CreateChangeIdForFocus(WindowMus* window) override; |
// The one int in |cursor_location_mapping_|. When we read from this |
// location, we must always read from it atomically. |
@@ -461,7 +468,9 @@ |
std::unique_ptr<CaptureSynchronizer> capture_synchronizer_; |
- std::unique_ptr<FocusSynchronizer> focus_synchronizer_; |
+ bool setting_focus_ = false; |
+ WindowMus* window_setting_focus_to_ = nullptr; |
+ WindowMus* focused_window_ = nullptr; |
mojo::Binding<ui::mojom::WindowTreeClient> binding_; |
ui::mojom::WindowTreePtr tree_ptr_; |